windows下为android搭建qt3d for qt5.1.1
Posted
技术标签:
【中文标题】windows下为android搭建qt3d for qt5.1.1【英文标题】:Building qt3d for qt5.1.1 for android under windows 【发布时间】:2013-11-05 13:53:38 【问题描述】:我正在尝试在 windows 下为 qt5 为 android 编译 qt3d。 为此,我遵循了这些步骤:http://qt-project.org/wiki/Qt5ForAndroidBuilding
我没有自己构建 QtCreator 和 Qt5,而是从这个页面下载了适用于 windows 的 android 版本:http://qt-project.org/downloads 这对于为 android 构建常见的 qt 项目非常有效,但是为 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-files 时,编译过程会抛出一些其他涉及 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:
qmake.exe C:\Qt\qt3d\qt-qt3d\qt3d.pro -r -spec android-g++
制作:
mingw32-make.exe in C:\Qt\qt3d\qt-qt3d
提前非常感谢您...
【问题讨论】:
【参考方案1】:我能够解决这个问题。问题是从 gitorious 定期下载 qt-3d。有必要完全克隆那个 qt-3d git。这个简单的下载会产生错误,因为头文件没有复制到包含文件夹中。克隆和编译存储库后,就会创建 qt-3d 库。这些库仍然没有复制到我的 qt5 安装中。我必须手动完成(将 lib、inc、mkspecs 复制到您的 qt5 安装中)。只有在 qt3d-module 被识别并有点可用之后。
现在我想尝试运行一个示例项目。
14:24:48: Running steps for project teapot...
14:24:48: Configuration unchanged, skipping qmake step.
14:24:48: Starting: "C:\Qt\Qt5.1.1\Tools\mingw48_32\bin\mingw32-make.exe"
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 -fno-exceptions -Wall -Wno-psabi -W -D_REENTRANT -fPIE -DQT_NO_PRINTDIALOG -DQT_NO_XKBCOMMON -DQT_NO_EXCEPTIONS -DQT_NO_DEBUG -DQT_3D_LIB -DQT_OPENGL_LIB -DQT_WIDGETS_LIB -DQT_GUI_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\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\QtCore -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-14\arch-arm\usr\include -o .obj\release_shared\teapotview.obj teapotview.cpp
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 -fno-exceptions -Wall -Wno-psabi -W -D_REENTRANT -fPIE -DQT_NO_PRINTDIALOG -DQT_NO_XKBCOMMON -DQT_NO_EXCEPTIONS -DQT_NO_DEBUG -DQT_3D_LIB -DQT_OPENGL_LIB -DQT_WIDGETS_LIB -DQT_GUI_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\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\QtCore -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-14\arch-arm\usr\include -o .obj\release_shared\main.obj main.cpp
C:\Qt\Qt5.1.1\5.1.1\android_armv7\bin\moc.exe -DQT_NO_PRINTDIALOG -DQT_NO_XKBCOMMON -DQT_NO_EXCEPTIONS -DQT_NO_DEBUG -DQT_3D_LIB -DQT_OPENGL_LIB -DQT_WIDGETS_LIB -DQT_GUI_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\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\QtCore -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-14\arch-arm\usr\include -I/usr/include -I/usr/local/include teapotview.h -o .moc\release_shared\moc_teapotview.cpp
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 -fno-exceptions -Wall -Wno-psabi -W -D_REENTRANT -fPIE -DQT_NO_PRINTDIALOG -DQT_NO_XKBCOMMON -DQT_NO_EXCEPTIONS -DQT_NO_DEBUG -DQT_3D_LIB -DQT_OPENGL_LIB -DQT_WIDGETS_LIB -DQT_GUI_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\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\QtCore -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-14\arch-arm\usr\include -o .obj\release_shared\moc_teapotview.obj .moc\release_shared\moc_teapotview.cpp
C:\Qt\android-ndk-r8e/toolchains/arm-linux-androideabi-4.7/prebuilt/windows/bin/arm-linux-androideabi-g++ --sysroot=C:\Qt\android-ndk-r8e/platforms/android-14/arch-arm/ -Wl,-soname,libteapot.so -Wl,-rpath-link=C:/Qt/Qt5.1.1/5.1.1/android_armv7/lib -Wl,--no-undefined -Wl,-z,noexecstack -shared -o ..\..\..\bin\libteapot.so .obj\release_shared\teapotview.obj .obj\release_shared\main.obj .obj\release_shared\moc_teapotview.obj -LC:\Qt\android-ndk-r8e/sources/cxx-stl/gnu-libstdc++/4.7/libs/armeabi-v7a -LC:\Qt\android-ndk-r8e/platforms/android-14/arch-arm//usr/lib -LC:/Qt/qt-3d/lib -lQt53D -lgnustl_shared -lsupc++ -llog -lz -lm -ldl -lc -lgcc -LC:\Qt\Qt5.1.1\5.1.1\android_armv7\lib -lQt5OpenGL -lQt5Widgets -lQt5Gui -lQt5Core -lGLESv2
14:24:56: The process "C:\Qt\Qt5.1.1\Tools\mingw48_32\bin\mingw32-make.exe" exited normally.
14:24:56: Elapsed time: 00:08.
所以茶壶示例的编译看起来不错。但是部署失败...
14:27:22: The process "C:\Qt\Qt5.1.1\Tools\mingw48_32\bin\mingw32-make.exe" exited normally.
14:27:22: Starting: "C:\Qt\Qt5.1.1\Tools\mingw48_32\bin\mingw32-make.exe" INSTALL_ROOT="C:\Qt\qt-3d\examples\qt3d\teapot\android" install
Die Syntax fr den Dateinamen, Verzeichnisnamen oder die Datentr„gerbezeichnung ist falsch.
makefile:1686: recipe for target 'install_target' failed
mingw32-make: *** [install_target] Error 1
14:27:24: The process "C:\Qt\Qt5.1.1\Tools\mingw48_32\bin\mingw32-make.exe" exited with code 2.
Error while building/deploying project teapot (kit: Android für arm (GCC 4.7, Qt 5.1.1)-Qt 5.1.1 for Android armv7)
When executing step 'Anwendungsdaten kopieren'
14:27:24: Elapsed time: 00:04.
通常在部署后应该创建一个 apk 文件,但不会发生类似的情况。对于该茶壶示例,创建了一个包含一些 obj 文件的 .obj 文件夹,但创建可执行文件失败。
【讨论】:
【参考方案2】:我在尝试为 BB10 的 Qt 4.8.4 编译 qt3d 1.x 时遇到了同样的错误。缺少的头文件是一些私有头文件,这些头文件在 BB NDK 的预构建 Qt SDK 中不可用,但是如果您下载 Qt 源代码并自行编译,它们是可用的。我没有为 BB10 编译 Qt 4.8.4,而是搜索了 Qt 4.8.4 的头文件名,并将它们复制到我现有 Qt 安装的相应位置。希望对您有所帮助。
【讨论】:
以上是关于windows下为android搭建qt3d for qt5.1.1的主要内容,如果未能解决你的问题,请参考以下文章
windows下python环境搭建及第一个hello world