我正在查看qt附带的Qt Sensors的示例应用程序,我已经在Windows上编译了它没有错误,但是当我尝试将它放到我的android上时,我得到了这个编译错误。
10:41:51: Running steps for project qmlqtsensors...
10:41:51: Configuration unchanged, skipping qmake step.
10:41:51: Starting: "C:\Qt\Qt5.2.1\Tools\mingw48_32\bin\mingw32-make.exe"
mingw32-make: Nothing to be done for 'first'.
10:41:52: The process "C:\Qt\Qt5.2.1\Tools\mingw48_32\bin\mingw32-make.exe" exited normally.
10:41:52: Removing directory C:\Qt\Qt5.2.1\5.2.1\android_x86\examples\sensors\build-qmlqtsensors-Android_for_armeabi_v7a_GCC_4_8_Qt_5_2_1-Release\android-build
10:41:52: Starting: "C:\Qt\Qt5.2.1\Tools\mingw48_32\bin\mingw32-make.exe" INSTALL_ROOT="C:\Qt\Qt5.2.1\5.2.1\android_x86\examples\sensors\build-qmlqtsensors-Android_for_armeabi_v7a_GCC_4_8_Qt_5_2_1-Release\android-build" install
copy /y "libqmlqtsensors.so" "C:\Qt\Qt5.2.1\5.2.1\android_x86\examples\sensors\build-qmlqtsensors-Android_for_armeabi_v7a_GCC_4_8_Qt_5_2_1-Release\android-build\libs\armeabi-v7a\libqmlqtsensors.so"
1 file(s) copied.
The full path of C:C:\Qt\Qt5.2.1\5.2.1\android_x86\examples\sensors\build-qmlqtsensors-Android_for_armeabi_v7a_GCC_4_8_Qt_5_2_1-Release\android-build\Qt\Qt5.2.1\5.2.1\android_armv7\examples\qtsensors\qmlqtsensors is too long.
makefile:873: recipe for target 'install_app' failed
mingw32-make: *** [install_app] Error 1
10:41:53: The process "C:\Qt\Qt5.2.1\Tools\mingw48_32\bin\mingw32-make.exe" exited with code 2.
Error while building/deploying project qmlqtsensors (kit: Android for armeabi-v7a (GCC 4.8, Qt 5.2.1))
When executing step 'Copy application data'
10:41:53: Elapsed time: 00:02.
我看了谷歌没有用。有人可以帮我解决这个问题吗?
答案 0 :(得分:0)
似乎错误或至少其中一个错误是因为文件qmlqtsensors的路径太长。
The full path of C:C:\Qt\Qt5.2.1\5.2.1\android_x86\examples\sensors\build-qmlqtsensors-Android_for_armeabi_v7a_GCC_4_8_Qt_5_2_1-Release\android-build\Qt\Qt5.2.1\5.2.1\android_armv7\examples\qtsensors\qmlqtsensors is too long.
尝试使用较短的路径在不同的位置编译和运行项目。
答案 1 :(得分:0)
我在这个例子中得到了错误(之前的例子和之前的例子一样)。
我的问题是,当生成Makefile时,它会生成错误的'码。它产生的东西如下: mkdir C:$(INSTALL_ROOT)/ ........
如果$(INSTALL_ROOT)计算到相对路径但实际上它已解析为绝对路径,那就没问题,即: mkdir C:C:/ Qt /.......
所以简单地编辑Makefile来替换所有出现的' C:$(INSTALL_ROOT)'与' $(INSTALL_ROOT)'。它对我有用,也有希望你。