Reputation: 910
I have trouble to compile on windows since I move on QT 5.0.1 (from http://qt-project.org/downloads) and the module qtsingleapplication (last version from http://qt.gitorious.org/qt-solutions).
Under Linux, the compilation still working (Qt 4.8.2)
I dont understand why. This is the detailed output from qtcreator.
09:57:58: Exécution des étapes pour le projet Wahoo...
09:57:58: Configuration inchangée, étape QMake sautée.
09:57:58: Débute : "D:\Qt\Qt5.0.1\Tools\MinGW\bin\mingw32-make.exe"D:/Qt/Qt5.0.1/Tools/MinGW/bin/mingw32-make -f Makefile.Release
mingw32-make[1]: Entering directory 'C:/Documents and Settings/crazy/Bureau/Kowmedia.Wahoo/src/Build-Release/release'g++ -c -pipe -fno-keep-inline-dllexport -O2 -frtti -Wall -Wextra -fexceptions -mthreads -DUNICODE -DQT_NO_DEBUG -DQT_WEBKIT_LIB -DQT_WIDGETS_LIB -DQT_XML_LIB -DQT_NETWORK_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_OPENGL_ES_2 -DQT_OPENGL_ES_2_ANGLE -DQT_NEEDS_QMAIN -I....\wahoo -I"....\wahoo\qtsingleapplication\src" -I"D:\Qt\Qt5.0.1\5.0.1\mingw47_32\include" -I"D:\Qt\Qt5.0.1\5.0.1\mingw47_32\include\QtWebKit" -I"D:\Qt\Qt5.0.1\5.0.1\mingw47_32\include\QtWidgets" -I"D:\Qt\Qt5.0.1\5.0.1\mingw47_32\include\QtXml" -I"D:\Qt\Qt5.0.1\5.0.1\mingw47_32\include\QtNetwork" -I"D:\Qt\Qt5.0.1\5.0.1\mingw47_32\include\QtGui" -I"D:\Qt\Qt5.0.1\5.0.1\mingw47_32\include\QtCore" -I"release" -I"." -I"." -I"D:\Qt\Qt5.0.1\5.0.1\mingw47_32\mkspecs\win32-g++" -o release\qtsingleapplication.o ....\wahoo\qtsingleapplication\src\qtsingleapplication.cpp
g++ -pipe -fno-keep-inline-dllexport -O2 -frtti -Wall -Wextra -fexceptions -mthreads -DUNICODE -DQT_NO_DEBUG -DQT_WEBKIT_LIB -DQT_WIDGETS_LIB -DQT_XML_LIB -DQT_NETWORK_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_OPENGL_ES_2 -DQT_OPENGL_ES_2_ANGLE -DQT_NEEDS_QMAIN ../../wahoo/qtsingleapplication/src/qtsingleapplication.cpp -o ../../wahoo/qtsingleapplication/src/QtSingleApplication
In file included from ../../wahoo/qtsingleapplication/src/qtsingleapplication.cpp:42:0:
../../wahoo/qtsingleapplication/src/qtsingleapplication.h:44:24: fatal error: QApplication: No such file or directorycompilation terminated.
<builtin>: recipe for target '../../wahoo/qtsingleapplication/src/QtSingleApplication' failed
mingw32-make[1]: ** [../../wahoo/qtsingleapplication/src/QtSingleApplication] Error 1
mingw32-make[1]: Leaving directory 'C:/Documents and Settings/crazy/Bureau/Kowmedia.Wahoo/src/Build-Release/release'
makefile:34: recipe for target 'release' failed
mingw32-make: ** [release] Error 2
09:57:59: Le processus "D:\Qt\Qt5.0.1\Tools\MinGW\bin\mingw32-make.exe" s'est terminé avec le code 2.
Error while building/deploying project Wahoo (kit: Desktop Qt 5.0.1 MinGW 32bit) Lors de l'exécution de l'étape "Make"
Every files are presents, the option -I"D:\Qt\Qt5.0.1\5.0.1\mingw47_32\include\QtWidgets" too. QtCreator can find the file if I browse from the source code. So I'm a bit lost ...
Thank you in advance
Upvotes: 4
Views: 29597
Reputation: 46
I'm new to Qt. And when i try the first program,after qmake -project qmake hello.pro
there appeared a mistake after 'make': 'QApplication'file not found
but with the same code,it can debug successfully on Qt Creator. the same mistake occured when i want to release it.
the solution is to modify the .pro file. Add the following two line:
QT += core gui
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
Upvotes: 0
Reputation: 1249
I also encountered this issue.
Once I added
QT += widgets
like Denjs suggested, I also needed to add:
INCLUDEPATH += $$PWD/../qtsingleapplication-2.6-opensource/src/
Which is the location of the QtSingleApplication source files.
Upvotes: 0
Reputation: 156
...QApplication: No such file or directory ...
try to add
QT += widgets
at your .pro file. I had the same message... It looks like from 5.0 Qt-based applications does not like widgets by default... Are everybody moved to QML ?
PS: now, as the next point in this quest - I have QPrinter to be not found )
Upvotes: 14
Reputation: 33506
It suggests that you have incorrectly configured library search paths in your IDE. The QT SDK libraries are not found. Have you installed everything using the QT tools and/or the installation manual?
"QApplication" is one of the header files, included by #include <qapplication>
. Depending on how and which SDK you installed, it may reside for example:
Nokia SDK with Carbide/Eclipse:
C:\????\Nokia\devices\Nokia_Symbian_Belle_SDK_v1.0\epoc32\include\mw\qtgui
QtCreator and QT SDK installer:
C:\????\QtSDK\Symbian\SDKs\SymbianSR1Qt474\include\QtGui
where ???? stands for the location you've chosen when installing the tools. First, check it you have the file.
It you have it, and if it is undamaged, and if you have not mistaken driveletters etc, then check your QT Project files and check if you really have all the imports and includes set correctly. Maybe you forgot some "\include" suffix, or maybe you have one too much? LINUX and WIN32 build configs usually differ in many settings, it's very easy to accidentially mix some conditionals that set up the paths
EDIT:
Thanks for the update! Paths indeed look OK
I've re-read your error log, and everything looked fine until I re-formatted it a little. Something strange popped out. Please look at the first G++ call and compare it witl the second one that fails.
The second one lacks all the paths setups. But this is normal. The first one performs compilation, the second one is linking. Distinguishable by the g++ -c
versus g++
wihtout "-c" parameter. But look at the FILES passed to G++.
The first one compiles qtsingleapplication.cpp
into qtsingleapplication.o
, while the second tries to link qtsingleapplication.cpp
into -o QtSingleApplication
.
I think that:
-I
pathsqtsingleapplication.o
instead of .cpp
I guess that you really have some switches/conditional messed up in your qtprojs for the :win32 cases.. I'm sorry I cannot tell you more, at this point, I'd have to try compiling the project myself and investigate the makefiles/qtprojs. Try backtracing how the second line gets generated and what makefile/qtproj variables are used, and then double- or even triple-check your project settings. Do it not in the IDE, but in the actual project files that are used. IDE sometimes hides some conditions and setups from you, especially QT Creator likes to do that..
Upvotes: 0