我正在尝试在 Windows 下为 qt5 为 android 编译 qt3d。为此,我遵循了这些步骤:http: //qt-project.org/wiki/Qt5ForAndroidBuilding
我没有自己构建 QtCreator 和 Qt5,而是从这个页面下载了适用于 windows 的 android 版本:http: //qt-project.org/downloads 这对于为 android 构建常见的 qt-projects 非常有效,但是为 android 编译 qt3d没有按预期工作。我已经通过右侧的下载按钮(不是该存储库的克隆)从 qit 下载了 qt3d,打开了该项目,将其配置为使用我的 qt5-android 并尝试下载。
我总是得到以下编译错误:
C:\Qt\qt3d\qt-qt3d\src\threed\global\qglnamespace.h:45: Fehler:Qt3D/qt3dglobal.h: No such file or directory
看起来,它试图包含不存在的头文件......至少不在项目文件夹结构中。如果我查看包含目录,这些文件夹(QT3D,QTQuick3d)存在,但没有必要的头文件。所以我相信 qmake 过程在某些时候会失败。
在分析 .pro 文件时,编译过程会引发一些其他与 cmake 有关的错误:
Project MESSAGE: cmake executable not found. Not running CMake unit tests
整个编译输出:
14:31:52: Führe Schritte für Projekt qt3d aus...
14:31:52: Starte "C:\Qt\Qt5.1.1\5.1.1\android_armv7\bin\qmake.exe" C:\Qt\qt3d\qt-qt3d\qt3d.pro -r -spec android-g++
Info: creating cache file C:/Qt/qt3d/qt-qt3d/.qmake.cache
Reading C:/Qt/qt3d/qt-qt3d/src/src.pro
Reading C:/Qt/qt3d/qt-qt3d/src/threed/threed.pro
Reading C:/Qt/qt3d/qt-qt3d/src/quick3d/quick3d.pro
Reading C:/Qt/qt3d/qt-qt3d/src/imports/imports.pro
Reading C:/Qt/qt3d/qt-qt3d/src/imports/threed/threed.pro
Reading C:/Qt/qt3d/qt-qt3d/tools/tools.pro
Reading C:/Qt/qt3d/qt-qt3d/tools/qt3d/qt3d.pro
Reading C:/Qt/qt3d/qt-qt3d/tools/qt3d/qglinfo/qglinfo.pro
Reading C:/Qt/qt3d/qt-qt3d/tools/meshcvt/meshcvt.pro
Reading C:/Qt/qt3d/qt-qt3d/examples/examples.pro
Reading C:/Qt/qt3d/qt-qt3d/examples/qt3d/qt3d.pro
Reading C:/Qt/qt3d/qt-qt3d/examples/qt3d/basket/basket.pro
Reading C:/Qt/qt3d/qt-qt3d/examples/qt3d/builder/builder.pro
Reading C:/Qt/qt3d/qt-qt3d/examples/qt3d/cube/cube.pro
Reading C:/Qt/qt3d/qt-qt3d/examples/qt3d/cylinder/cylinder.pro
Reading C:/Qt/qt3d/qt-qt3d/examples/qt3d/geometry/geometry.pro
Reading C:/Qt/qt3d/qt-qt3d/examples/qt3d/nesting/nesting.pro
Reading C:/Qt/qt3d/qt-qt3d/examples/qt3d/solarsystem/solarsystem.pro
Reading C:/Qt/qt3d/qt-qt3d/examples/qt3d/tank/tank.pro
Reading C:/Qt/qt3d/qt-qt3d/examples/qt3d/teapot/teapot.pro
Reading C:/Qt/qt3d/qt-qt3d/examples/qt3d/load_model/load_model.pro
Reading C:/Qt/qt3d/qt-qt3d/examples/quick3d/quick3d.pro
Reading C:/Qt/qt3d/qt-qt3d/examples/quick3d/basket/basket.pro
Reading C:/Qt/qt3d/qt-qt3d/examples/quick3d/cube/cube.pro
Reading C:/Qt/qt3d/qt-qt3d/examples/quick3d/forest/forest.pro
Reading C:/Qt/qt3d/qt-qt3d/examples/quick3d/lander/lander.pro
Reading C:/Qt/qt3d/qt-qt3d/examples/quick3d/matrix_animation/matrix_animation.pro
Reading C:/Qt/qt3d/qt-qt3d/examples/quick3d/positional_lighting/positional_lighting.pro
Reading C:/Qt/qt3d/qt-qt3d/examples/quick3d/monkeygod/monkeygod.pro
Reading C:/Qt/qt3d/qt-qt3d/examples/quick3d/moon/moon.pro
Reading C:/Qt/qt3d/qt-qt3d/examples/quick3d/photoroom/photoroom.pro
Reading C:/Qt/qt3d/qt-qt3d/examples/quick3d/shaders/shaders.pro
Reading C:/Qt/qt3d/qt-qt3d/examples/quick3d/sphere/sphere.pro
Reading C:/Qt/qt3d/qt-qt3d/examples/quick3d/animations/animations.pro
Reading C:/Qt/qt3d/qt-qt3d/demos/demos.pro
Reading C:/Qt/qt3d/qt-qt3d/demos/qt3d/qt3d.pro
Reading C:/Qt/qt3d/qt-qt3d/demos/qt3d/teaservice/teaservice.pro
Reading C:/Qt/qt3d/qt-qt3d/demos/qt3d/shapes/shapes.pro
Reading C:/Qt/qt3d/qt-qt3d/demos/qt3d/pageflip/pageflip.pro
Reading C:/Qt/qt3d/qt-qt3d/demos/qt3d/cubehouse/cubehouse.pro
Reading C:/Qt/qt3d/qt-qt3d/demos/qt3d/photobrowser3d/photobrowser3d.pro
Reading C:/Qt/qt3d/qt-qt3d/demos/quick3d/quick3d.pro
Reading C:/Qt/qt3d/qt-qt3d/demos/quick3d/robo_bounce/robo_bounce.pro
Reading C:/Qt/qt3d/qt-qt3d/demos/quick3d/tea_service/tea_service.pro
Reading C:/Qt/qt3d/qt-qt3d/demos/quick3d/flickr3d/flickr3d.pro
Reading C:/Qt/qt3d/qt-qt3d/tests/tests.pro
Reading C:/Qt/qt3d/qt-qt3d/tests/manual/manual.pro
Reading C:/Qt/qt3d/qt-qt3d/tests/manual/animations/animations.pro
Reading C:/Qt/qt3d/qt-qt3d/tests/manual/basic/basic.pro
Reading C:/Qt/qt3d/qt-qt3d/tests/manual/background/background.pro
Reading C:/Qt/qt3d/qt-qt3d/tests/manual/displaymodel/displaymodel.pro
Reading C:/Qt/qt3d/qt-qt3d/tests/manual/fullreferencing/fullreferencing.pro
Reading C:/Qt/qt3d/qt-qt3d/tests/manual/model3ds/model3ds.pro
Reading C:/Qt/qt3d/qt-qt3d/tests/manual/navigation1/navigation1.pro
Reading C:/Qt/qt3d/qt-qt3d/tests/manual/qrc/qrc.pro
Reading C:/Qt/qt3d/qt-qt3d/tests/manual/rotation/rotation.pro
Reading C:/Qt/qt3d/qt-qt3d/tests/manual/scaling/scaling.pro
Reading C:/Qt/qt3d/qt-qt3d/tests/manual/shapes/shapes.pro
Reading C:/Qt/qt3d/qt-qt3d/tests/manual/submesh/submesh.pro
Reading C:/Qt/qt3d/qt-qt3d/tests/manual/translation/translation.pro
Reading C:/Qt/qt3d/qt-qt3d/tests/manual/transformations/transformations.pro
Reading C:/Qt/qt3d/qt-qt3d/tests/auto/auto.pro
Reading C:/Qt/qt3d/qt-qt3d/tests/auto/threed/threed.pro
Reading C:/Qt/qt3d/qt-qt3d/tests/auto/threed/qareaallocator/qareaallocator.pro
Reading C:/Qt/qt3d/qt-qt3d/tests/auto/threed/qarray/qarray.pro
Reading C:/Qt/qt3d/qt-qt3d/tests/auto/threed/qbox3d/qbox3d.pro
Reading C:/Qt/qt3d/qt-qt3d/tests/auto/threed/qcolor4ub/qcolor4ub.pro
Reading C:/Qt/qt3d/qt-qt3d/tests/auto/threed/qcustomdataarray/qcustomdataarray.pro
Reading C:/Qt/qt3d/qt-qt3d/tests/auto/threed/qgeometrydata/qgeometrydata.pro
Reading C:/Qt/qt3d/qt-qt3d/tests/auto/threed/qglabstractsurface/qglabstractsurface.pro
Reading C:/Qt/qt3d/qt-qt3d/tests/auto/threed/qglattributedescription/qglattributedescription.pro
Reading C:/Qt/qt3d/qt-qt3d/tests/auto/threed/qglattributeset/qglattributeset.pro
Reading C:/Qt/qt3d/qt-qt3d/tests/auto/threed/qglattributevalue/qglattributevalue.pro
Reading C:/Qt/qt3d/qt-qt3d/tests/auto/threed/qglbezierpatches/qglbezierpatches.pro
Reading C:/Qt/qt3d/qt-qt3d/tests/auto/threed/qglbuilder/qglbuilder.pro
Reading C:/Qt/qt3d/qt-qt3d/tests/auto/threed/qglcamera/qglcamera.pro
Reading C:/Qt/qt3d/qt-qt3d/tests/auto/threed/qglcameraanimation/qglcameraanimation.pro
Reading C:/Qt/qt3d/qt-qt3d/tests/auto/threed/qglcube/qglcube.pro
Reading C:/Qt/qt3d/qt-qt3d/tests/auto/threed/qglindexbuffer/qglindexbuffer.pro
Reading C:/Qt/qt3d/qt-qt3d/tests/auto/threed/qgllightmodel/qgllightmodel.pro
Reading C:/Qt/qt3d/qt-qt3d/tests/auto/threed/qgllightparameters/qgllightparameters.pro
Reading C:/Qt/qt3d/qt-qt3d/tests/auto/threed/qglmaterial/qglmaterial.pro
Reading C:/Qt/qt3d/qt-qt3d/tests/auto/threed/qglmaterialcollection/qglmaterialcollection.pro
Reading C:/Qt/qt3d/qt-qt3d/tests/auto/threed/qglpainter/qglpainter.pro
Reading C:/Qt/qt3d/qt-qt3d/tests/auto/threed/qglpickcolors/qglpickcolors.pro
Reading C:/Qt/qt3d/qt-qt3d/tests/auto/threed/qglrender/qglrender.pro
Reading C:/Qt/qt3d/qt-qt3d/tests/auto/threed/qglscenenode/qglscenenode.pro
Reading C:/Qt/qt3d/qt-qt3d/tests/auto/threed/qglsection/qglsection.pro
Reading C:/Qt/qt3d/qt-qt3d/tests/auto/threed/qglsphere/qglsphere.pro
Reading C:/Qt/qt3d/qt-qt3d/tests/auto/threed/qglvertexbundle/qglvertexbundle.pro
Reading C:/Qt/qt3d/qt-qt3d/tests/auto/threed/qgraphicstransform3d/qgraphicstransform3d.pro
Reading C:/Qt/qt3d/qt-qt3d/tests/auto/threed/qplane3d/qplane3d.pro
Reading C:/Qt/qt3d/qt-qt3d/tests/auto/threed/qray3d/qray3d.pro
Reading C:/Qt/qt3d/qt-qt3d/tests/auto/threed/qglcylinder/qglcylinder.pro
Reading C:/Qt/qt3d/qt-qt3d/tests/auto/threed/qsphere3d/qsphere3d.pro
Reading C:/Qt/qt3d/qt-qt3d/tests/auto/threed/qtriangle3d/qtriangle3d.pro
Reading C:/Qt/qt3d/qt-qt3d/tests/auto/threed/qvectorarray/qvectorarray.pro
Reading C:/Qt/qt3d/qt-qt3d/tests/auto/threed/load_model/load_model.pro
Reading C:/Qt/qt3d/qt-qt3d/tests/auto/threed/qglcolladafxeffectfactory/qglcolladafxeffectfactory.pro
Reading C:/Qt/qt3d/qt-qt3d/tests/auto/cmake/cmake.pro
Das System kann den angegebenen Pfad nicht finden.
Reading C:/Qt/qt3d/qt-qt3d/tests/auto/imports/imports.pro
Reading C:/Qt/qt3d/qt-qt3d/tests/auto/imports/qcapsulemesh/qcapsulemesh.pro
Reading C:/Qt/qt3d/qt-qt3d/tests/auto/imports/qcylindermesh/qcylindermesh.pro
Reading C:/Qt/qt3d/qt-qt3d/tests/auto/imports/qspheremesh/qspheremesh.pro
Reading C:/Qt/qt3d/qt-qt3d/tests/auto/imports/qline/qline.pro
Reading C:/Qt/qt3d/qt-qt3d/tests/auto/imports/qpoint/qpoint.pro
Reading C:/Qt/qt3d/qt-qt3d/tests/auto/qml3d/qml3d.pro
Reading C:/Qt/qt3d/qt-qt3d/tests/auto/qml3d_visual/qml3d_visual.pro
Reading C:/Qt/qt3d/qt-qt3d/tests/auto/qml3d_cpp/qml3d_cpp.pro
Reading C:/Qt/qt3d/qt-qt3d/tests/auto/qml3d_cpp/picking/picking.pro
Reading C:/Qt/qt3d/qt-qt3d/tests/benchmarks/benchmarks.pro
Reading C:/Qt/qt3d/qt-qt3d/tests/benchmarks/qarray/qarray.pro
Reading C:/Qt/qt3d/qt-qt3d/tests/benchmarks/qglbuilder_perf/qglbuilder_perf.pro
Reading C:/Qt/qt3d/qt-qt3d/tests/benchmarks/matrix_properties/matrix_properties.pro
Reading C:/Qt/qt3d/qt-qt3d/tutorials/tutorials.pro
Reading C:/Qt/qt3d/qt-qt3d/tutorials/qt3d/qt3d.pro
Reading C:/Qt/qt3d/qt-qt3d/tutorials/qt3d/penguin/penguin.pro
Reading C:/Qt/qt3d/qt-qt3d/tutorials/qt3d/penguin_advanced/penguin_advanced.pro
Reading C:/Qt/qt3d/qt-qt3d/tutorials/qt3d/cube1/cube1.pro
Reading C:/Qt/qt3d/qt-qt3d/tutorials/qt3d/cube2/cube2.pro
Reading C:/Qt/qt3d/qt-qt3d/tutorials/qt3d/cube3/cube3.pro
Reading C:/Qt/qt3d/qt-qt3d/tutorials/qt3d/cube4/cube4.pro
Reading C:/Qt/qt3d/qt-qt3d/tutorials/quick3d/quick3d.pro
Reading C:/Qt/qt3d/qt-qt3d/tutorials/quick3d/shadertut/shadertut.pro
Reading C:/Qt/qt3d/qt-qt3d/tutorials/quick3d/teapot_bounce_qml/teapot_bounce_qml.pro
Reading C:/Qt/qt3d/qt-qt3d/tutorials/quick3d/teapot_qml/teapot_qml.pro
Project MESSAGE: cmake executable not found. Not running CMake unit tests
14:33:08: Der Prozess "C:\Qt\Qt5.1.1\5.1.1\android_armv7\bin\qmake.exe" wurde normal beendet.
14:33:08: Starte "C:\Qt\Qt5.1.1\Tools\mingw48_32\bin\mingw32-make.exe"
cd src\ && ( if not exist Makefile C:\Qt\Qt5.1.1\5.1.1\android_armv7\bin\qmake.exe C:\Qt\qt3d\qt-qt3d\src\src.pro -spec android-g++ -o Makefile ) && C:/Qt/Qt5.1.1/Tools/mingw48_32/bin/mingw32-make -f Makefile
mingw32-make[1]: Entering directory 'C:/Qt/qt3d/qt-qt3d/src'
cd threed\ && ( if not exist Makefile C:\Qt\Qt5.1.1\5.1.1\android_armv7\bin\qmake.exe C:\Qt\qt3d\qt-qt3d\src\threed\threed.pro -spec android-g++ -o Makefile ) && C:/Qt/Qt5.1.1/Tools/mingw48_32/bin/mingw32-make -f Makefile
mingw32-make[2]: Entering directory 'C:/Qt/qt3d/qt-qt3d/src/threed'
C:\Qt\android-ndk-r8e/toolchains/arm-linux-androideabi-4.7/prebuilt/windows/bin/arm-linux-androideabi-g++ -c -Wno-psabi -march=armv7-a -mfloat-abi=softfp -mfpu=vfp -ffunction-sections -funwind-tables -fstack-protector -fno-short-enums -DANDROID -Wa,--noexecstack -std=gnu++0x -O2 -mthumb -Os -fomit-frame-pointer -fno-strict-aliasing -finline-limit=64 -fvisibility=hidden -fvisibility-inlines-hidden -Wall -Wno-psabi -W -D_REENTRANT -fPIC -DQT_NO_PRINTDIALOG -DQT_NO_XKBCOMMON -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=0x050000 -DQT_NO_DEBUG -DQT_OPENGL_LIB -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -IC:\Qt\Qt5.1.1\5.1.1\android_armv7\mkspecs\android-g++ -I. -I..\..\include -I..\..\include\Qt3D -IC:/Qt/qt3d/qt-qt3d/include/Qt3D/5.3.0 -IC:/Qt/qt3d/qt-qt3d/include/Qt3D/5.3.0/Qt3D -I..\private -Iglobal -Ipainting -Iarrays -Ieffects -Imaterials -Igeometry -Iviewing -Imath3d -Iscene -Iscene_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\ConvertUTF -I..\..\3rdparty\assimp\contrib\zlib -I..\..\3rdparty\assimp\contrib\irrXML -I..\..\3rdparty\assimp\contrib\unzip -Iscene_bezier -Inetwork -Igraphicsview -Itextures -Isurfaces -Iapi -IC:\Qt\Qt5.1.1\5.1.1\android_armv7\include -IC:\Qt\Qt5.1.1\5.1.1\android_armv7\include\QtOpenGL -IC:\Qt\Qt5.1.1\5.1.1\android_armv7\include\QtWidgets -IC:\Qt\Qt5.1.1\5.1.1\android_armv7\include\QtGui -IC:\Qt\Qt5.1.1\5.1.1\android_armv7\include\QtGui\5.1.1 -IC:\Qt\Qt5.1.1\5.1.1\android_armv7\include\QtGui\5.1.1\QtGui -IC:\Qt\Qt5.1.1\5.1.1\android_armv7\include\QtCore -IC:\Qt\Qt5.1.1\5.1.1\android_armv7\include\QtCore\5.1.1 -IC:\Qt\Qt5.1.1\5.1.1\android_armv7\include\QtCore\5.1.1\QtCore -IC:\Qt\Qt5.1.1\5.1.1\android_armv7\include\QtNetwork -I.moc\release_shared -IC:\Qt\android-ndk-r8e\sources\cxx-stl\gnu-libstdc++\4.7\include -IC:\Qt\android-ndk-r8e\sources\cxx-stl\gnu-libstdc++\4.7\libs\armeabi-v7a\include -IC:\Qt\android-ndk-r8e\platforms\android-9\arch-arm\usr\include -o .obj\release_shared\qglnamespace.obj global\qglnamespace.cpp
In file included from global\qglnamespace.cpp:42:0:
global\qglnamespace.h:45:29: fatal error: Qt3D/qt3dglobal.h: No such file or directory
compilation terminated.
Makefile:8497: recipe for target '.obj\release_shared\qglnamespace.obj' failed
mingw32-make[2]: *** [.obj\release_shared\qglnamespace.obj] Error 1
mingw32-make[2]: Leaving directory 'C:/Qt/qt3d/qt-qt3d/src/threed'
Makefile:40: recipe for target 'sub-threed-make_first-ordered' failed
mingw32-make[1]: *** [sub-threed-make_first-ordered] Error 2
mingw32-make[1]: Leaving directory 'C:/Qt/qt3d/qt-qt3d/src'
mingw32-make: *** [sub-src-make_first] Error 2
makefile:43: recipe for target 'sub-src-make_first' failed
14:33:12: Der Prozess "C:\Qt\Qt5.1.1\Tools\mingw48_32\bin\mingw32-make.exe" wurde mit dem Rückgabewert 2 beendet.
Fehler beim Erstellen/Deployment des Projekts qt3d(Kit: Android für arm (GCC 4.7, Qt 5.1.1)-Qt 5.1.1 for Android armv7)
Bei der Ausführung von Schritt 'Make'
我的其他一些同事说我应该克隆整个存储库,因为下载有问题。在我看来,qmake 进程无法正常工作。
制作:
qmake.exe C:\Qt\qt3d\qt-qt3d\qt3d.pro -r -spec android-g++
制作:
mingw32-make.exe in C:\Qt\qt3d\qt-qt3d
非常感谢您提前...