我正在尝试在Qt项目中使用QtSolution的QtService。
我解压缩并运行: configure.bat -library QMAKE 的mingw32-MAKE
调试和发布dll放在C:\ Qt \ 2010.03 \ qt \ bin \中 示例已正确构建。
我在.pro文件的底部添加了这一行: 包括(../ QtSolutions / qtservice / SRC / qtservice.pri)
我能够从项目源代码树中浏览qtservice的源代码。
当我尝试构建我的项目时,我得到了:
Running build steps for project EMCSolutionCrawler... Configuration unchanged, skipping QMake step. Starting: C:/Qt/2010.03/mingw/bin/mingw32-make.exe -w mingw32-make: Entering directory `C:/Progetti/EMCSolutionCrawler' c:\qt\2010.03\qt\bin\qmake.exe -spec ..\..\Qt\2010.03\qt\mkspecs\win32-g++ -win32 -o Makefile EMCSolutionCrawler.pro mingw32-make: Leaving directory `C:/Progetti/EMCSolutionCrawler' mingw32-make: Entering directory `C:/Progetti/EMCSolutionCrawler' C:/Qt/2010.03/mingw/bin/mingw32-make -f Makefile.Debug mingw32-make[1]: Entering directory `C:/Progetti/EMCSolutionCrawler' g++ -g -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_QTSERVICE_IMPORT -DQT_DLL -DQT_SQL_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT ../QtSolutions/qtservice/src/QtService.cpp -o ../QtSolutions/qtservice/src/QtService mingw32-make[1]: Leaving directory `C:/Progetti/EMCSolutionCrawler' mingw32-make: Leaving directory `C:/Progetti/EMCSolutionCrawler' In file included from ../QtSolutions/qtservice/src/QtService.cpp:47: ../QtSolutions/qtservice/src/qtservice.h:50:35: error: QtCore/QCoreApplication: No such file or directory In file included from ../QtSolutions/qtservice/src/QtService.cpp:48: ../QtSolutions/qtservice/src/qtservice_p.h:50:30: error: QtCore/QStringList: No such file or directory ../QtSolutions/qtservice/src/QtService.cpp:51:25: error: QtCore/QTimer: No such file or directory ../QtSolutions/qtservice/src/QtService.cpp:52:26: error: QtCore/QVector: No such file or directory ../QtSolutions/qtservice/src/QtService.cpp:53:27: error: QtCore/QProcess: No such file or directory ../QtSolutions/qtservice/src/QtService.cpp:426:25: error: qtservice.moc: No such file or directory In file included from ../QtSolutions/qtservice/src/QtService.cpp:47: ../QtSolutions/qtservice/src/qtservice.h:73: error: ISO C++ forbids declaration of 'Q_DECLARE_PRIVATE' with no type ../QtSolutions/qtservice/src/qtservice.h:74: error: expected ';' before 'public' ../QtSolutions/qtservice/src/qtservice.h:80: error: ISO C++ forbids declaration of 'QString' with no type ../QtSolutions/qtservice/src/qtservice.h:80: error: expected ',' or '...' before '&' token ../QtSolutions/qtservice/src/qtservice.h:86: error: 'QString' does not name a type ../QtSolutions/qtservice/src/qtservice.h:87: error: 'QString' does not name a type ../QtSolutions/qtservice/src/qtservice.h:88: error: 'StartupType' does not name a type ../QtSolutions/qtservice/src/qtservice.h:89: error: 'QString' does not name a type ../QtSolutions/qtservice/src/qtservice.h:91: error: ISO C++ forbids declaration of 'QString' with no type ../QtSolutions/qtservice/src/qtservice.h:91: error: expected ',' or '...' before '&' token ../QtSolutions/qtservice/src/qtservice.h:110: error: ISO C++ forbids declaration of 'Q_DECLARE_PRIVATE' with no type ../QtSolutions/qtservice/src/qtservice.h:111: error: expected ';' before 'public' ../QtSolutions/qtservice/src/qtservice.h:125: error: 'ServiceFlags' has not been declared ../QtSolutions/qtservice/src/qtservice.h:125: error: ISO C++ forbids declaration of 'Q_DECLARE_FLAGS' with no type ../QtSolutions/qtservice/src/qtservice.h:127: error: expected ';' before 'QtServiceBase' ../QtSolutions/qtservice/src/qtservice.h:130: error: 'QString' does not name a type ...
我错过了什么?
环境信息: Qt 4.6.3(mingw - LGPL) Windows XP SP3 QtService 2.6
感谢您的时间。
答案 0 :(得分:0)
猜猜:我在-IC:\Qt\2010.03\qt\include
的电话中看不到包含g++
。所以编译器找不到Qt Headers。我认为您的 EMCSolutionCrawler.pro 中存在问题。