C++ 在windows7下编译Qt3D

C++ 在windows7下编译Qt3D,c++,qt,mingw,qmake,qt3d,C++,Qt,Mingw,Qmake,Qt3d,我正试图通过以下说明编译和安装Qt3D: 我使用的是Windows方法,我使用的是Qt-MinGW终端 我第一次做这个过程的时候,它抱怨我缺乏自信。这似乎与教程相反。所以我安装了。我找不到关于这些构建脚本在Windows上所期望的Perl风格的建议 当我说: qmake qt3d.pro mingw32-make -j 3 install 它的执行速度令人怀疑 当我说: qmake qt3d.pro mingw32-make -j 3 install 我收到这个错误: :\qt3d

我正试图通过以下说明编译和安装Qt3D:

我使用的是Windows方法,我使用的是Qt-MinGW终端

我第一次做这个过程的时候,它抱怨我缺乏自信。这似乎与教程相反。所以我安装了。我找不到关于这些构建脚本在Windows上所期望的Perl风格的建议

当我说:

qmake qt3d.pro
mingw32-make -j 3 install 
它的执行速度令人怀疑

当我说:

qmake qt3d.pro
mingw32-make -j 3 install 
我收到这个错误:

:\qt3d>mingw32-make -j 3 install
d src/ && ( test -e Makefile || C:/Qt/5.1.1/mingw48_32/bin/qmake.exe C:/qt3d/src/src.pro -o Makefile ) && mingw32-make -f Makefile install
ingw32-make[1]: Entering directory 'c:/qt3d/src'
d threed/ && ( test -e Makefile || c:/Qt/5.1.1/mingw48_32/bin/qmake.exe C:/qt3d/src/threed/threed.pro -o Makefile ) && c:/Qt/Tools/mingw48_32/bin/mingw32-make
f Makefile install
usr/bin/sh: c:/Qt/Tools/mingw48_32/bin/mingw32-make: Invalid argument
akefile:64: recipe for target 'sub-threed-install_subtargets-ordered' failed
ingw32-make[1]: *** [sub-threed-install_subtargets-ordered] Error 126
ingw32-make[1]: Leaving directory 'c:/qt3d/src'
akefile:55: recipe for target 'sub-src-install_subtargets' failed
ingw32-make: *** [sub-src-install_subtargets] Error 2
坦率地说,我不知道该如何理解这个错误

我可能做错了什么

上述误差由Qt5.1产生

下面是我通过与Qt5.3完全相同的过程产生的类似错误

C:\qt3d>mingw32-make -j 3 install
cd src/ && ( test -e Makefile || C:/Qt/Qt5.3.0/5.3/mingw482_32/bin/qmake.exe C:/qt3d/src/src.pro -o Makefile ) && mingw32-make -f Makefile install
mingw32-make[1]: Entering directory 'c:/qt3d/src'
cd threed/ && ( test -e Makefile || c:/Qt/5.1.1/mingw48_32/bin/qmake.exe C:/qt3d/src/threed/threed.pro -o Makefile ) && c:/Qt/Qt5.3.0/Tools/mingw482_32/bin/ming
w32-make -f Makefile install
mingw32-make[2]: Entering directory 'c:/qt3d/src/threed'
c:/Qt/Qt5.3.0/Tools/mingw482_32/bin/mingw32-make -f Makefile.Release install
c:/Qt/Qt5.3.0/Tools/mingw482_32/bin/mingw32-make -f Makefile.Debug install
mingw32-make[3]: Entering directory 'c:/qt3d/src/threed'
g++ -c -pipe -fno-keep-inline-dllexport -O2 -fexceptions -mthreads -std=gnu++0x -frtti -Wall -Wextra -DUNICODE -DQT_BUILD_3D_LIB -DQT_BUILDING_QT -DQT_NO_CAST_T
O_ASCII -DQT_ASCII_CAST_WARNINGS -DQT_MOC_COMPAT -DQT_USE_QSTRINGBUILDER -DQT_DEPRECATED_WARNINGS -DQT_DISABLE_DEPRECATED_BEFORE=0x040800 -D_USE_MATH_DEFINES -D
_SCL_SECURE_NO_WARNINGS -D_CRT_SECURE_NO_WARNINGS -DQT_NO_EGL -DQT_NO_DEBUG -DQT_OPENGL_LIB -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_NETWORK_LIB -DQT_CO
RE_LIB -I. -I'../../include' -I'../../include/Qt3D' -I'../../include/Qt3D/5.3.0' -I'../../include/Qt3D/5.3.0/Qt3D' -I'tmp' -I'../private' -I'global' -I'painting
' -I'arrays' -I'effects' -I'materials' -I'geometry' -I'viewing' -I'math3d' -I'scene' -I'scene_ai' -I'../../3rdparty/assimp' -I'../../3rdparty/assimp/code' -I'..
/../3rdparty/assimp/code/BoostWorkaround' -I'../../3rdparty/assimp/include' -I'../../3rdparty/assimp/include/Compiler' -I'../../3rdparty/assimp/contrib/ConvertU
TF' -I'../../3rdparty/assimp/contrib/zlib' -I'../../3rdparty/assimp/contrib/irrXML' -I'../../3rdparty/assimp/contrib/unzip' -I'scene_bezier' -I'network' -I'grap
hicsview' -I'textures' -I'surfaces' -I'api' -I'C:/Qt/5.1.1/mingw48_32/include' -I'C:/Qt/5.1.1/mingw48_32/include/QtOpenGL' -I'C:/Qt/5.1.1/mingw48_32/include/QtW
idgets' -I'C:/Qt/5.1.1/mingw48_32/include/QtGui' -I'C:/Qt/5.1.1/mingw48_32/include/QtGui/5.1.1' -I'C:/Qt/5.1.1/mingw48_32/include/QtGui/5.1.1/QtGui' -I'C:/Qt/5.
1.1/mingw48_32/include/QtCore' -I'C:/Qt/5.1.1/mingw48_32/include/QtCore/5.1.1' -I'C:/Qt/5.1.1/mingw48_32/include/QtCore/5.1.1/QtCore' -I'C:/Qt/5.1.1/mingw48_32/
include/QtNetwork' -I'.moc/release_shared' -I'C:/Qt/5.1.1/mingw48_32/mkspecs/win32-g++' -o .obj/release_shared/qglpainter.o painting/qglpainter.cpp
g++ -c -pipe -fno-keep-inline-dllexport -O2 -fexceptions -mthreads -std=gnu++0x -frtti -Wall -Wextra -DUNICODE -DQT_BUILD_3D_LIB -DQT_BUILDING_QT -DQT_NO_CAST_T
O_ASCII -DQT_ASCII_CAST_WARNINGS -DQT_MOC_COMPAT -DQT_USE_QSTRINGBUILDER -DQT_DEPRECATED_WARNINGS -DQT_DISABLE_DEPRECATED_BEFORE=0x040800 -D_USE_MATH_DEFINES -D
_SCL_SECURE_NO_WARNINGS -D_CRT_SECURE_NO_WARNINGS -DQT_NO_EGL -DQT_NO_DEBUG -DQT_OPENGL_LIB -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_NETWORK_LIB -DQT_CO
RE_LIB -I. -I'../../include' -I'../../include/Qt3D' -I'../../include/Qt3D/5.3.0' -I'../../include/Qt3D/5.3.0/Qt3D' -I'tmp' -I'../private' -I'global' -I'painting
' -I'arrays' -I'effects' -I'materials' -I'geometry' -I'viewing' -I'math3d' -I'scene' -I'scene_ai' -I'../../3rdparty/assimp' -I'../../3rdparty/assimp/code' -I'..
/../3rdparty/assimp/code/BoostWorkaround' -I'../../3rdparty/assimp/include' -I'../../3rdparty/assimp/include/Compiler' -I'../../3rdparty/assimp/contrib/ConvertU
TF' -I'../../3rdparty/assimp/contrib/zlib' -I'../../3rdparty/assimp/contrib/irrXML' -I'../../3rdparty/assimp/contrib/unzip' -I'scene_bezier' -I'network' -I'grap
hicsview' -I'textures' -I'surfaces' -I'api' -I'C:/Qt/5.1.1/mingw48_32/include' -I'C:/Qt/5.1.1/mingw48_32/include/QtOpenGL' -I'C:/Qt/5.1.1/mingw48_32/include/QtW
idgets' -I'C:/Qt/5.1.1/mingw48_32/include/QtGui' -I'C:/Qt/5.1.1/mingw48_32/include/QtGui/5.1.1' -I'C:/Qt/5.1.1/mingw48_32/include/QtGui/5.1.1/QtGui' -I'C:/Qt/5.
1.1/mingw48_32/include/QtCore' -I'C:/Qt/5.1.1/mingw48_32/include/QtCore/5.1.1' -I'C:/Qt/5.1.1/mingw48_32/include/QtCore/5.1.1/QtCore' -I'C:/Qt/5.1.1/mingw48_32/
include/QtNetwork' -I'.moc/release_shared' -I'C:/Qt/5.1.1/mingw48_32/mkspecs/win32-g++' -o .obj/release_shared/qglattributedescription.o arrays/qglattributedesc
ription.cpp
mingw32-make[3]: Entering directory 'c:/qt3d/src/threed'
g++ -c -pipe -fno-keep-inline-dllexport -g -fexceptions -mthreads -std=gnu++0x -frtti -Wall -Wextra -DUNICODE -DQT_BUILD_3D_LIB -DQT_BUILDING_QT -DQT_NO_CAST_TO
_ASCII -DQT_ASCII_CAST_WARNINGS -DQT_MOC_COMPAT -DQT_USE_QSTRINGBUILDER -DQT_DEPRECATED_WARNINGS -DQT_DISABLE_DEPRECATED_BEFORE=0x040800 -D_USE_MATH_DEFINES -D_
SCL_SECURE_NO_WARNINGS -D_DEBUG -D_CRT_SECURE_NO_WARNINGS -DQT_NO_EGL -DQT_OPENGL_LIB -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB
 -I. -I'../../include' -I'../../include/Qt3D' -I'../../include/Qt3D/5.3.0' -I'../../include/Qt3D/5.3.0/Qt3D' -I'tmp' -I'../private' -I'global' -I'painting' -I'a
rrays' -I'effects' -I'materials' -I'geometry' -I'viewing' -I'math3d' -I'scene' -I'scene_ai' -I'../../3rdparty/assimp' -I'../../3rdparty/assimp/code' -I'../../3r
dparty/assimp/code/BoostWorkaround' -I'../../3rdparty/assimp/include' -I'../../3rdparty/assimp/include/Compiler' -I'../../3rdparty/assimp/contrib/ConvertUTF' -I
'../../3rdparty/assimp/contrib/zlib' -I'../../3rdparty/assimp/contrib/irrXML' -I'../../3rdparty/assimp/contrib/unzip' -I'scene_bezier' -I'network' -I'graphicsvi
ew' -I'textures' -I'surfaces' -I'api' -I'C:/Qt/5.1.1/mingw48_32/include' -I'C:/Qt/5.1.1/mingw48_32/include/QtOpenGL' -I'C:/Qt/5.1.1/mingw48_32/include/QtWidgets
' -I'C:/Qt/5.1.1/mingw48_32/include/QtGui' -I'C:/Qt/5.1.1/mingw48_32/include/QtGui/5.1.1' -I'C:/Qt/5.1.1/mingw48_32/include/QtGui/5.1.1/QtGui' -I'C:/Qt/5.1.1/mi
ngw48_32/include/QtCore' -I'C:/Qt/5.1.1/mingw48_32/include/QtCore/5.1.1' -I'C:/Qt/5.1.1/mingw48_32/include/QtCore/5.1.1/QtCore' -I'C:/Qt/5.1.1/mingw48_32/includ
e/QtNetwork' -I'.moc/debug_shared' -I'C:/Qt/5.1.1/mingw48_32/mkspecs/win32-g++' -o .obj/debug_shared/qglpainter.o painting/qglpainter.cpp
g++ -c -pipe -fno-keep-inline-dllexport -g -fexceptions -mthreads -std=gnu++0x -frtti -Wall -Wextra -DUNICODE -DQT_BUILD_3D_LIB -DQT_BUILDING_QT -DQT_NO_CAST_TO
_ASCII -DQT_ASCII_CAST_WARNINGS -DQT_MOC_COMPAT -DQT_USE_QSTRINGBUILDER -DQT_DEPRECATED_WARNINGS -DQT_DISABLE_DEPRECATED_BEFORE=0x040800 -D_USE_MATH_DEFINES -D_
SCL_SECURE_NO_WARNINGS -D_DEBUG -D_CRT_SECURE_NO_WARNINGS -DQT_NO_EGL -DQT_OPENGL_LIB -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB
 -I. -I'../../include' -I'../../include/Qt3D' -I'../../include/Qt3D/5.3.0' -I'../../include/Qt3D/5.3.0/Qt3D' -I'tmp' -I'../private' -I'global' -I'painting' -I'a
rrays' -I'effects' -I'materials' -I'geometry' -I'viewing' -I'math3d' -I'scene' -I'scene_ai' -I'../../3rdparty/assimp' -I'../../3rdparty/assimp/code' -I'../../3r
dparty/assimp/code/BoostWorkaround' -I'../../3rdparty/assimp/include' -I'../../3rdparty/assimp/include/Compiler' -I'../../3rdparty/assimp/contrib/ConvertUTF' -I
'../../3rdparty/assimp/contrib/zlib' -I'../../3rdparty/assimp/contrib/irrXML' -I'../../3rdparty/assimp/contrib/unzip' -I'scene_bezier' -I'network' -I'graphicsvi
ew' -I'textures' -I'surfaces' -I'api' -I'C:/Qt/5.1.1/mingw48_32/include' -I'C:/Qt/5.1.1/mingw48_32/include/QtOpenGL' -I'C:/Qt/5.1.1/mingw48_32/include/QtWidgets
' -I'C:/Qt/5.1.1/mingw48_32/include/QtGui' -I'C:/Qt/5.1.1/mingw48_32/include/QtGui/5.1.1' -I'C:/Qt/5.1.1/mingw48_32/include/QtGui/5.1.1/QtGui' -I'C:/Qt/5.1.1/mi
ngw48_32/include/QtCore' -I'C:/Qt/5.1.1/mingw48_32/include/QtCore/5.1.1' -I'C:/Qt/5.1.1/mingw48_32/include/QtCore/5.1.1/QtCore' -I'C:/Qt/5.1.1/mingw48_32/includ
e/QtNetwork' -I'.moc/debug_shared' -I'C:/Qt/5.1.1/mingw48_32/mkspecs/win32-g++' -o .obj/debug_shared/qglvertexbundle.o arrays/qglvertexbundle.cpp
painting/qglpainter.cpp: In member function 'int QGLPainter::pickObject(int, int) const':
painting/qglpainter.cpp:2348:29: error: 'class QOpenGLFunctions' has no member named 'glReadPixels'
     context()->functions()->glReadPixels(x, y, 1, 1, GL_RGBA, GL_UNSIGNED_BYTE, data);
                             ^
painting/qglpainter.cpp: In member function 'int QGLPainter::pickObject(int, int) const':
painting/qglpainter.cpp:2348:29: error: 'class QOpenGLFunctions' has no member named 'glReadPixels'
     context()->functions()->glReadPixels(x, y, 1, 1, GL_RGBA, GL_UNSIGNED_BYTE, data);
                             ^
Makefile.Release:4156: recipe for target '.obj/release_shared/qglpainter.o' failed
mingw32-make[3]: *** [.obj/release_shared/qglpainter.o] Error 1
mingw32-make[3]: Leaving directory 'c:/qt3d/src/threed'
Makefile:44: recipe for target 'release-install' failed
mingw32-make[2]: *** [release-install] Error 2
mingw32-make[2]: *** Waiting for unfinished jobs....
g++ -c -pipe -fno-keep-inline-dllexport -g -fexceptions -mthreads -std=gnu++0x -frtti -Wall -Wextra -DUNICODE -DQT_BUILD_3D_LIB -DQT_BUILDING_QT -DQT_NO_CAST_TO
_ASCII -DQT_ASCII_CAST_WARNINGS -DQT_MOC_COMPAT -DQT_USE_QSTRINGBUILDER -DQT_DEPRECATED_WARNINGS -DQT_DISABLE_DEPRECATED_BEFORE=0x040800 -D_USE_MATH_DEFINES -D_
SCL_SECURE_NO_WARNINGS -D_DEBUG -D_CRT_SECURE_NO_WARNINGS -DQT_NO_EGL -DQT_OPENGL_LIB -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB
 -I. -I'../../include' -I'../../include/Qt3D' -I'../../include/Qt3D/5.3.0' -I'../../include/Qt3D/5.3.0/Qt3D' -I'tmp' -I'../private' -I'global' -I'painting' -I'a
rrays' -I'effects' -I'materials' -I'geometry' -I'viewing' -I'math3d' -I'scene' -I'scene_ai' -I'../../3rdparty/assimp' -I'../../3rdparty/assimp/code' -I'../../3r
dparty/assimp/code/BoostWorkaround' -I'../../3rdparty/assimp/include' -I'../../3rdparty/assimp/include/Compiler' -I'../../3rdparty/assimp/contrib/ConvertUTF' -I
'../../3rdparty/assimp/contrib/zlib' -I'../../3rdparty/assimp/contrib/irrXML' -I'../../3rdparty/assimp/contrib/unzip' -I'scene_bezier' -I'network' -I'graphicsvi
ew' -I'textures' -I'surfaces' -I'api' -I'C:/Qt/5.1.1/mingw48_32/include' -I'C:/Qt/5.1.1/mingw48_32/include/QtOpenGL' -I'C:/Qt/5.1.1/mingw48_32/include/QtWidgets
' -I'C:/Qt/5.1.1/mingw48_32/include/QtGui' -I'C:/Qt/5.1.1/mingw48_32/include/QtGui/5.1.1' -I'C:/Qt/5.1.1/mingw48_32/include/QtGui/5.1.1/QtGui' -I'C:/Qt/5.1.1/mi
ngw48_32/include/QtCore' -I'C:/Qt/5.1.1/mingw48_32/include/QtCore/5.1.1' -I'C:/Qt/5.1.1/mingw48_32/include/QtCore/5.1.1/QtCore' -I'C:/Qt/5.1.1/mingw48_32/includ
e/QtNetwork' -I'.moc/debug_shared' -I'C:/Qt/5.1.1/mingw48_32/mkspecs/win32-g++' -o .obj/debug_shared/qarray.o arrays/qarray.cpp
Makefile.Debug:4155: recipe for target '.obj/debug_shared/qglpainter.o' failed
mingw32-make[3]: *** [.obj/debug_shared/qglpainter.o] Error 1
mingw32-make[3]: *** Waiting for unfinished jobs....
mingw32-make[3]: Leaving directory 'c:/qt3d/src/threed'
Makefile:58: recipe for target 'debug-install' failed
mingw32-make[2]: *** [debug-install] Error 2
mingw32-make[2]: Leaving directory 'c:/qt3d/src/threed'
Makefile:64: recipe for target 'sub-threed-install_subtargets-ordered' failed
mingw32-make[1]: *** [sub-threed-install_subtargets-ordered] Error 2
mingw32-make[1]: Leaving directory 'c:/qt3d/src'
Makefile:55: recipe for target 'sub-src-install_subtargets' failed
mingw32-make: *** [sub-src-install_subtargets] Error 2

C:\qt3d>

类似的错误。我做错了什么?

将我的评论转化为正确的答案:

问:它的执行速度令人怀疑

您希望在递归生成系统结构(如
Qt3D
)中递归运行qmake。这意味着您需要将-r选项传递给qmake,如果使用QtCreator,默认情况下会传递该选项。手动运行qmake时,需要在命令行上明确显示


另外,请注意,“旧”(当前主)Qt3D代码库未维护,因此即将发布的Qt版本可能会出现问题,尽管当时它获得了一些补丁,以便更好地使用Qt 5。如果由于新的Qt版本而出现问题,您可以创建并希望发送补丁,或者只是降级您的主Qt版本。

我遇到了与Qt5.3相同的问题,在Windows7上使用Qt5.2.1构建Qt3D。我通过在qglpainter.cpp的第2348行更改
context->functions()->glReadPixels()
解决了这个问题

这是因为终端中存在此错误:

painting/qglpainter.cpp: In member function 'int QGLPainter::pickObject(int, int) const':
painting/qglpainter.cpp:2348:29: error: 'class QOpenGLFunctions' has no member named 'glReadPixels'
     context()->functions()->glReadPixels(x, y, 1, 1, GL_RGBA, GL_UNSIGNED_BYTE, data);

现在安装了Qt3D。

在计算机上安装perl后,在编译时仍有问题的所有人都可以查看Qt3D文件夹的路径。它应该没有空格。

它的执行速度令人怀疑。
->我认为您希望在递归构建系统结构中递归运行qmake。这意味着您需要将
-r
选项传递给qmake,我认为,如果使用QtCreator,默认情况下会传递该选项。您需要在命令行上明确显示。事实证明,我必须使用-r标志,更改一些源代码,并使用较旧版本的qt终端。为了使其能够构建,我还必须使用较旧版本的qt终端(5.1)。Qt5.3似乎工作正常,但我有一些问题。@baordog:QT,不是QT;-)我不确定你在这个上下文中所说的“终端”是什么意思。你指的是主要的Qt版本,对吧?我上面提到的教程规定,使用Qt提供的特殊终端(每个Qt发行版都附带)就像Qt MinGw。是的,这很有帮助。我把一切都准备好了。