[Qt-interest] why moc_xxx.cpp generated from xxx.h file

Vincent Cai wcai at cypress.com
Mon Oct 17 10:01:28 CEST 2011


Hi,

         I have a project which make use of the QSerialDevice static library.
    So I need to include below QSerialDevice related header file:
    abstractserial.h
    Qserialdevice_global.h
    Serialdeviceenumerator.h

         If I just included the header files into project without added them into project, everything is OK.
         But when I add above header files into project, below error reported:

mingw32-make[1]: Entering directory `E:/wcai_perforce/LTS_R3/CFT members/WCAI/Projects/TSA/Qt/MapViewer-build-desktop'
g++ -c -g -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_GUI_LIB -DQT_CORE_LIB -DQT_HAVE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -I"d:\QtSDK\Desktop\Qt\4.7.3\mingw\include\QtCore" -I"d:\QtSDK\Desktop\Qt\4.7.3\mingw\include\QtGui" -I"d:\QtSDK\Desktop\Qt\4.7.3\mingw\include" -I"..\MapViewer\Gen4_src" -I"..\MapViewer\DataViewer" -I"..\MapViewer\QSerialDevice" -I"..\MapViewer\TSA\TSAUtility" -I"..\MapViewer\TSA\TSAConfig" -I"..\MapViewer\TSA" -I"d:\QtSDK\Desktop\Qt\4.7.3\mingw\include\ActiveQt" -I"debug" -I"." -I"..\MapViewer" -I"." -I"d:\QtSDK\Desktop\Qt\4.7.3\mingw\mkspecs\win32-g++" -o debug\moc_serialdeviceenumerator.o debug\moc_serialdeviceenumerator.cpp
debug\moc_serialdeviceenumerator.cpp: In member function 'virtual int SerialDeviceEnumerator::qt_metacall(QMetaObject::Call, int, void**)':
debug\moc_serialdeviceenumerator.cpp:77: error: invalid use of incomplete type 'struct SerialDeviceEnumeratorPrivate'
debug\/../../MapViewer/QSerialDevice/serialdeviceenumerator.h:31: error: forward declaration of 'struct SerialDeviceEnumeratorPrivate'
mingw32-make[1]: Leaving directory `E:/wcai_perforce/LTS_R3/CFT members/WCAI/Projects/TSA/Qt/MapViewer-build-desktop'


         It seems that Qt Creator try to create moc_serialdeviceenumerator.cpp and report compiling error.
         Anybody help?

Thanks,
Vincent.

________________________________
This message and any attachments may contain Cypress (or its subsidiaries) confidential information. If it has been received in error, please advise the sender and immediately delete this message.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20111017/852e8b0e/attachment.html 


More information about the Qt-interest-old mailing list