1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
C:\work\qm54>mingw32-make mingw32-make -f Makefile.Release mingw32-make[1]: Entering directory 'C:/work/qm54' g++ -c -pipe -fno-keep-inline-dllexport -O2 -frtti -Wall -Wextra -fexceptions -m threads -DUNICODE -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_NEEDS_QMAIN -I. -I"..\..\Qt\5.4\mingw491_32\include" -I"..\..\Qt\5.4\mingw491_32\include\QtGui" -I"..\..\Qt\5.4\mingw491_32\include\QtCore" -I"release" -I"..\..\Qt\5.4\mingw491 _32\mkspecs\win32-g++" -o release\hello.o hello.cpp In file included from hello.cpp:42:0: hello.h:41:23: fatal error: QPushButton: No such file or directory #include <QPushButton> ^ compilation terminated. Makefile.Release:191: recipe for target 'release/hello.o' failed mingw32-make[1]: *** [release/hello.o] Error 1 mingw32-make[1]: Leaving directory 'C:/work/qm54' makefile:34: recipe for target 'release' failed mingw32-make: *** [release] Error 2 C:\work\qm54> |
hello.proの最初に以下の行を足す
1 |
QT += widgets |
qmakeからやり直す
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
C:\work\qm54>qmake C:\work\qm54>nmake Microsoft (R) Program Maintenance Utility Version 6.00.9782.0 Copyright (C) Microsoft Corp 1988-1998. All rights reserved. NMAKE -f Makefile.Release Microsoft (R) Program Maintenance Utility Version 6.00.9782.0 Copyright (C) Microsoft Corp 1988-1998. All rights reserved. g++ -c -pipe -fno-keep-inline-dllexport -O2 -frtti -Wall -Wextra -fexcep tions -mthreads -DUNICODE -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_ LIB -DQT_NEEDS_QMAIN -I. -I"..\..\Qt\5.4\mingw491_32\include" -I"..\..\Qt\5.4\mi ngw491_32\include\QtWidgets" -I"..\..\Qt\5.4\mingw491_32\include\QtGui" -I"..\.. \Qt\5.4\mingw491_32\include\QtCore" -I"release" -I"..\..\Qt\5.4\mingw491_32\mksp ecs\win32-g++" -o release\hello.o hello.cpp g++ -c -pipe -fno-keep-inline-dllexport -O2 -frtti -Wall -Wextra -fexcep tions -mthreads -DUNICODE -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_ LIB -DQT_NEEDS_QMAIN -I. -I"..\..\Qt\5.4\mingw491_32\include" -I"..\..\Qt\5.4\mi ngw491_32\include\QtWidgets" -I"..\..\Qt\5.4\mingw491_32\include\QtGui" -I"..\.. \Qt\5.4\mingw491_32\include\QtCore" -I"release" -I"..\..\Qt\5.4\mingw491_32\mksp ecs\win32-g++" -o release\main.o main.cpp g++ -Wl,-s -Wl,-subsystem,windows -mthreads -o release\hello.exe release /hello.o release/main.o -lglu32 -lopengl32 -lgdi32 -luser32 -lmingw32 -LC:/Qt/ 5.4/mingw491_32/lib -lqtmain -LC:\mingw491\mingw32\lib -LC:\Utils\icu32_53_1_min gw482\lib -LC:\utils\postgresql\pgsql\lib -LC:\utils\mysql\mysql\lib -LC:\opensl l\lib -lshell32 -LC:\Qt\5.4\mingw491_32/lib -lQt5Widgets -lQt5Gui -lQt5Core C:\work\qm54> |
できた。
nmakeがない場合はmingw32-makeでできる。
1 |
C:\work\qm54>release\hello.exe |