Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/154.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ 不使用.pro文件的QtWidgets/QApplication_C++_Qt_Qt5 - Fatal编程技术网

C++ 不使用.pro文件的QtWidgets/QApplication

C++ 不使用.pro文件的QtWidgets/QApplication,c++,qt,qt5,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

在构建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
make
检测到GCC 4.9.2
正在编译src/osd/modules/debugger/debugqt.cpp。。。
../../../../src/osd/modules/debugger/debugqt.cpp:20:30:致命错误:QtWidgets/QApplication:没有这样的文件或目录
#包括
^
编译终止。
qtdbg_sdl.make:361:目标'../../../../linux_gcc/obj/x64/Release/qtdbg_sdl/src/osd/modules/debugger/debugqt.o'的配方失败
make[2]:***[../../../../linux\u gcc/obj/x64/Release/qtdbg\u sdl/src/osd/modules/debugger/debugqt.o]错误1
Makefile:16:目标“qtdbg_sdl”的配方失败
生成[1]:***[qtdbg_sdl]错误2
makefile:1003:目标“linux_x64”的配方失败
make:**[linux_x64]错误2

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

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

~$ qmake -project /*this makes .pro file*/
~$ qmake -makefile /*this creates makefile*/
~$ make
为了创建正确的makefile,始终需要首先运行qmake

~$ echo "happy qt coding"

这个答案是错误的。构建qt应用程序不需要qmake或.pro文件。请参阅示例。唯一的(可能的)要求是生成标准C++,它可以通过任何编译器(或构建工具)运行,那么,编译一个简单的Hello World QT应用程序的命令是什么?这将取决于编译器,但是<代码> G++HeloWorld。CPP < /代码>对于最简单的情况(没有代码需要MOC)就足够了。Qt的IDE和构建工具是可选的,并且与框架本身是独立的。