不使用.pro文件的QtWidgets / QApplication

时间:2015-12-31 18:44:49

标签: c++ qt qt5

构建MAME时出现此错误:

make
GCC 4.9.2 detected
Compiling src/osd/modules/debugger/debugqt.cpp...
../../../../../src/osd/modules/debugger/debugqt.cpp:20:30: fatal error: QtWidgets/QApplication: No such file or directory
 #include <QtWidgets/QApplication>
                                  ^
compilation terminated.
qtdbg_sdl.make:361: recipe for target '../../../../linux_gcc/obj/x64/Release/qtdbg_sdl/src/osd/modules/debugger/debugqt.o' failed
make[2]: *** [../../../../linux_gcc/obj/x64/Release/qtdbg_sdl/src/osd/modules/debugger/debugqt.o] Error 1
Makefile:16: recipe for target 'qtdbg_sdl' failed
make[1]: *** [qtdbg_sdl] Error 2
makefile:1003: recipe for target 'linux_x64' failed
make: *** [linux_x64] Error 2

如何在没有.pro文件的情况下修复此错误,因为我无法在任何地方找到它。

1 个答案:

答案 0 :(得分:0)

这是qt应用程序的构建过程:

~$ qmake -project /*this makes .pro file*/
~$ qmake -makefile /*this creates makefile*/
~$ make

你总是需要先运行qmake才能创建正确的makefile

~$ echo "happy qt coding"