Qt can't include anything
-
I have a problem with Qt. I made some code yesterday and yesterday
everything worked fine, but today it doesn't want to compile. I reinstalled Qt two times and still got same message on different projects. Someone know how to deal with this? Here is error that i got from compile outputC:/Qt/Tools/mingw492_32/bin/mingw32-make -f Makefile.Debug mingw32-make[1]: Entering directory 'C:/Users/michal/Documents/build-Game_2-Desktop_Qt_5_6_3_MinGW_32bit-Debug' g++ -c -pipe -fno-keep-inline-dllexport -g -std=gnu++0x -frtti -Wall -Wextra -fexceptions -mthreads -DUNICODE -DQT_DEPRECATED_WARNINGS -DQT_QML_DEBUG -DQT_MULTIMEDIA_LIB -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_NEEDS_QMAIN -I..\Game_2 -I. -I..\..\..\..\Qt\5.6.3\mingw49_32\include -I..\..\..\..\Qt\5.6.3\mingw49_32\include\QtMultimedia -I..\..\..\..\Qt\5.6.3\mingw49_32\include\QtWidgets -I..\..\..\..\Qt\5.6.3\mingw49_32\include\QtGui -I..\..\..\..\Qt\5.6.3\mingw49_32\include\QtANGLE -I..\..\..\..\Qt\5.6.3\mingw49_32\include\QtNetwork -I..\..\..\..\Qt\5.6.3\mingw49_32\include\QtCore -Idebug -I. -I..\..\..\..\Qt\5.6.3\mingw49_32\mkspecs\win32-g++ -o debug\game.o ..\Game_2\game.cpp g++ -c -pipe -fno-keep-inline-dllexport -g -std=gnu++0x -frtti -Wall -Wextra -fexceptions -mthreads -DUNICODE -DQT_DEPRECATED_WARNINGS -DQT_QML_DEBUG -DQT_MULTIMEDIA_LIB -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_NEEDS_QMAIN -I..\Game_2 -I. -I..\..\..\..\Qt\5.6.3\mingw49_32\include -I..\..\..\..\Qt\5.6.3\mingw49_32\include\QtMultimedia -I..\..\..\..\Qt\5.6.3\mingw49_32\include\QtWidgets -I..\..\..\..\Qt\5.6.3\mingw49_32\include\QtGui -I..\..\..\..\Qt\5.6.3\mingw49_32\include\QtANGLE -I..\..\..\..\Qt\5.6.3\mingw49_32\include\QtNetwork -I..\..\..\..\Qt\5.6.3\mingw49_32\include\QtCore -Idebug -I. -I..\..\..\..\Qt\5.6.3\mingw49_32\mkspecs\win32-g++ -o debug\bullet.o ..\Game_2\bullet.cpp ..\Game_2\bullet.cpp:6:31: warning: unused parameter 'parent' [-Wunused-parameter] Bullet::Bullet(QGraphicsItem *parent){ ^ g++ -pipe -fno-keep-inline-dllexport -g -std=gnu++0x -frtti -Wall -Wextra -fexceptions -mthreads -DUNICODE -DQT_DEPRECATED_WARNINGS -DQT_QML_DEBUG -DQT_MULTIMEDIA_LIB -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_NEEDS_QMAIN ../Game_2/bullet.cpp -o ../Game_2/bullet In file included from ../Game_2/bullet.cpp:2:0: ../Game_2/bullet.h:3:19: fatal error: QObject: No such file or directory #include <QObject> ^ compilation terminated. <builtin>: recipe for target '../Game_2/bullet' failed mingw32-make[1]: Leaving directory 'C:/Users/michal/Documents/build-Game_2-Desktop_Qt_5_6_3_MinGW_32bit-Debug' makefile:34: recipe for target 'debug' failed mingw32-make[1]: *** [../Game_2/bullet] Error 1 mingw32-make: *** [debug] Error 2 14:46:40: The process "C:\Qt\Tools\mingw492_32\bin\mingw32-make.exe" exited with code 2. Error while building/deploying project Game_2 (kit: Desktop Qt 5.6.3 MinGW 32bit) When executing step "Make" 14:46:40: Elapsed time: 00:03.
And here is a code:
https://github.com/michaloxs/Game_2
I dunno what is going on. I think that something in bullet class isn't right because i got an error from there. -
Hi, welcome to the forum.
Try this:
Close Qt Creator.
DeleteGame_2.pro.user
file.
Delete theC:/Users/michal/Documents/build-Game_2-Desktop_Qt_5_6_3_MinGW_32bit-Debug
andC:/Users/michal/Documents/build-Game_2-Desktop_Qt_5_6_3_MinGW_32bit-Release
directories.
Open Qt Creator and your project, select one kit and build.Btw. The
.user
file is a local, user specific configuration file. You shouldn't put that in a repository.
Btw.2 Your.user
file indicates that you have configured your project to use 5 different Qt kits. Was that really your intention? -
@NoName97
Just tried your project and it just works.
Did you delete the build folder as Mr @Chris-Kawa suggests?
-
Hi,
In that case, did you check that you didn't modify your Qt installation somehow ?
Did you check your Kit ?
-
Did you have any system update happening in between ?