Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] build Point_Set demo error with .moc

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] build Point_Set demo error with .moc


Chronological Thread 
  • From: "Sebastien Loriot (GeometryFactory)" <>
  • To:
  • Subject: Re: [cgal-discuss] build Point_Set demo error with .moc
  • Date: Mon, 27 Dec 2010 08:36:10 +0100

cmodel wrote:
Hi all,
I have used CMake generated VC9 project for Point_Set demo. and when try
build within MSVS9, it gave errors of moc generation.

1>------ Build started: Project: PS_demo_off_plugin, Configuration: Debug
Win32 ------
1>Generating PS_demo_off_plugin.moc
1>moc: Too many input files specified
1>Usage: moc [options] <header-file>
1> -o<file> write output to file rather than stdout
1> -I<dir> add dir to the include path for header files
1> -E preprocess only; do not generate meta object code
1> -D<macro>[=<def>] define macro, with optional definition
1> -U<macro> undefine macro
1> -i do not generate an #include statement
1> -p<path> path prefix for included file
1> -f[<file>] force #include, optional file name
1> -nw do not display warnings
1> @<file> read additional options from file
1> -v display version of moc
1>Project : error PRJ0019: A tool returned an error code from "Generating
PS_demo_off_plugin.moc"


Then I tried generating MOC with batch file I used in the following:

C:\Qt\4.7.1\bin\moc.exe -D_MSC_VER=1500 -DWIN32 -o .\PS_demo_off_plugin.moc
.\PS_demo_off_plugin.cpp

Then everything looks fine. and can generate .moc file and build succeeded.

But whereafter I want to build again, it pops up strange error.

1>Compiling...
1>PS_demo_off_plugin.moc
1>.\PS_demo_off_plugin.moc(11) : fatal error C1189: #error : "The header
file 'PS_demo_off_plugin.cpp' doesn't include <QObject>."

I then tried re-generate that .moc again manually, but cannot fix it.



Then I found the following MACRO in the .moc file.

#if !defined(Q_MOC_OUTPUT_REVISION)
#error "The header file 'PS_demo_off_plugin.cpp' doesn't include <QObject>."


I don't know why I can build successfully at my first time, whereas not
working now?

Please help me. Thanks.
Leon
Is the moc.exe used by cmake the same than you manually used?

S.



Archive powered by MHonArc 2.6.16.

Top of Page