I am creating a project that uses Qt 4.3.3 and Qwt 5.1.1 (http://qwt.sourceforge.net/).
I am using CMake version 2.4 to generate the project files for MS Visual Studio 2005 Pro (on Windows XP Pro)
I create a derived class ScatterPlot that inherits from QwtPlot and QObject.
I run into a linking error when I use the Q_OBJECT macro in my derived class as shown in attached files.
The moc_scatterplot.cxx and the moc_scatterplot.obj files are created during compilation.
If I remove the Q_OBJECT macro from the header, it compiles fine.
What am I missing? Thanks, Isaac
************************************************** ************************************************** ************************
Build Output
************************************************** ************************************************** ************************
1>------ Build started: Project: ThreeSpaceViewer, Configuration: Debug Win32 ------
1>Generating moc_scatterplot.cxx
1>Compiling...
1>moc_scatterplot.cxx
1>main.cpp
1>Generating Code...
1>Linking...
1>moc_scatterplot.obj : error LNK2001: unresolved external symbol "public: static struct QMetaObject const QwtPlot::staticMetaObject" (?staticMetaObject@QwtPlot@@2UQMetaObject@@B)
1>Debug\ThreeSpaceViewer.exe : fatal error LNK1120: 1 unresolved externals
1>Build log was saved at "file://c:\Isaac\Fars_Isaac\qwt2qt\bin\ThreeSpaceViewer.di r\Debug\BuildLog.htm"
1>ThreeSpaceViewer - 2 error(s), 0 warning(s)
2>------ Skipped Build: Project: ALL_BUILD, Configuration: Debug Win32 ------
2>Project not selected to build for this solution configuration
========== Build: 0 succeeded, 1 failed, 1 up-to-date, 1 skipped ==========
Bookmarks