Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

QApplication: No such file or directory with Qt5 and qtsingleapplication on windows

Tags:

c++

windows

qt5

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

like image 203
Sébastien Bémelmans Avatar asked Dec 12 '22 17:12

Sébastien Bémelmans


1 Answers

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

like image 52
Denjs Avatar answered Dec 28 '22 08:12

Denjs