PDA

View Full Version : QtGui/QApplication : No such file or directorty



sliverTwist
25th February 2013, 12:08
Hello
I've downloaded this project https://github.com/owncloud/sync-qt and followed the steps mentioned below but when i compile i get this error QtGui/QApplication : No such file or directorty

Any help please
I'am using Qt creator 2.6.2
based on Qt 5.0.1 (32 bit)
My os is XP SP 2 and the creation and compilation of any created project is working well :confused: :confused: :confused:

This is my compile Output:
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
12:12:18: Running steps for project sync_qt...
12:12:18: Starting: "C:\Qt\Qt5.0.1\5.0.1\mingw47_32\bin\qmake.exe" "C:\Documents and Settings\sliver\Desktop\sync-qt-master\sync-qt-master\sync_qt.pro" -r -spec win32-g++ "CONFIG+=debug" "CONFIG+=declarative_debug" "CONFIG+=qml_debug" "DEFINES += OCS_USE_KWALLET"
'getconf' is not recognized as an internal or external command,
operable program or batch file.
'getconf' is not recognized as an internal or external command,
operable program or batch file.
'getconf' is not recognized as an internal or external command,
operable program or batch file.
12:12:20: The process "C:\Qt\Qt5.0.1\5.0.1\mingw47_32\bin\qmake.exe" exited normally.
12:12:20: Starting: "C:\Qt\Qt5.0.1\Tools\MinGW\bin\mingw32-make.exe"
C:/Qt/Qt5.0.1/Tools/MinGW/bin/mingw32-make -f Makefile.Debug
mingw32-make[1]: Entering directory 'C:/Documents and Settings/sliver/Desktop/sync-qt-master/sync_qt-build-Desktop_Qt_5_0_1_MinGW_32bit-Debug'
g++ -c -pipe -fno-keep-inline-dllexport -g -frtti -Wall -Wextra -fexceptions -mthreads -DUNICODE -DOCS_USE_KWALLET -DQT_QML_DEBUG -DQT_DECLARATIVE_DEBUG -DQT_SQL_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..\sync-qt-master -I"..\sync-qt-master\qwebdav" -I"\usr\include" -I"..\..\..\..\..\Qt\Qt5.0.1\5.0.1\mingw47_32\include" -I"..\..\..\..\..\Qt\Qt5.0.1\5.0.1\mingw47_32\include \QtSql" -I"..\..\..\..\..\Qt\Qt5.0.1\5.0.1\mingw47_32\include \QtXml" -I"..\..\..\..\..\Qt\Qt5.0.1\5.0.1\mingw47_32\include \QtNetwork" -I"..\..\..\..\..\Qt\Qt5.0.1\5.0.1\mingw47_32\include \QtGui" -I"..\..\..\..\..\Qt\Qt5.0.1\5.0.1\mingw47_32\include \QtCore" -I"debug" -I"." -I"..\..\..\..\..\Qt\Qt5.0.1\5.0.1\mingw47_32\mkspecs \win32-g++" -o debug\main.o ..\sync-qt-master\main.cpp
..\sync-qt-master\main.cpp:19:30: fatal error: QtGui/QApplication: No such file or directory
compilation terminated.
Makefile.Debug:693: recipe for target 'debug/main.o' failed
mingw32-make[1]: *** [debug/main.o] Error 1
mingw32-make[1]: Leaving directory 'C:/Documents and Settings/sliver/Desktop/sync-qt-master/sync_qt-build-Desktop_Qt_5_0_1_MinGW_32bit-Debug'
mingw32-make: *** [debug] Error 2
makefile:34: recipe for target 'debug' failed
12:12:20: The process "C:\Qt\Qt5.0.1\Tools\MinGW\bin\mingw32-make.exe" exited with code 2.
Error while building/deploying project sync_qt (kit: Desktop Qt 5.0.1 MinGW 32bit)
When executing step 'Make'
compilation terminated.

Zlatomir
25th February 2013, 14:01
QApplication and Qwidgets derived classes are in widgets module in Qt 5 so to fix that you need to add QT += widgets in the .pro file and run qmake and also use #include <QApplication> instead of #include <QtGui/QApplication> (and the code becomes compatible with both Qt 4 and 5), you can read more here (http://qt-project.org/wiki/Transition_from_Qt_4.x_to_Qt5)

u2bpavankumar
12th February 2015, 13:34
QApplication and Qwidgets derived classes are in widgets module in Qt 5 so to fix that you need to add QT += widgets in the .pro file and run qmake and also use #include <QApplication> instead of #include <QtGui/QApplication> (and the code becomes compatible with both Qt 4 and 5), you can read more here (http://qt-project.org/wiki/Transition_from_Qt_4.x_to_Qt5)

I had a similar problem and your solution worked. Thanks