4
votes

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 directory

compilation 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

4
Probably you missed to add includepath while compiling QtSingleApplicationBlood
Have you come up with a solution to this problem? I'm stumbling with it on Qt 5.4 on Windows (works fine on Qt 5.4 on Linux) Tracking down the problem, looks like although the Makefile.Release line reads $(CXX) -c $(CXXFLAGS) $(INCPATH) ../qt-solutions/qtsingleapplication/src/qtsingleapplication.cpp, the actual command is g++ (...) -DQT_WIDGETS_LIB -DQT_GUI_LIB (...) ../include-3rdparty/qt-solutions/qtsingleapplication/src/qtsingleapplication.cpp -o ../include-3rdparty/qt-solutions/qtsingleapplication/src/QtSingleApplication, so $(INCPATH) is missingRazZziel
I finally solved it by removing the greaterThan(QT_MAJOR_VERSION, 4): QT *= widgets line in qtsingleapplication/src/qtsingleapplication.priRazZziel

4 Answers

13
votes

...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 )

0
votes

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:

  • either the second line forgot the parameter "-c" and all the -I paths
  • or the second line has invalid input file and should have qtsingleapplication.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..

0
votes

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.

0
votes

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