QtCreator android不会部署

时间:2014-03-20 16:01:31

标签: android c++ qt

我想在android模拟器中运行一个简单的应用程序。当我编译时,我得到以下内容:

/Users/derek/software/android-ndk-r9d/toolchains/arm-linux-androideabi-4.8/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-g++ -c -pipe -std=gnu++0x -O2 -mthumb -Os -fomit-frame-pointer -fno-strict-aliasing -finline-limit=64 -Wall -Wno-psabi -W -D_REENTRANT -fPIE -DQT_NO_DEBUG -DQT_QUICK_LIB -DQT_QML_LIB -DQT_NETWORK_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I../../Qt/5.2.1/android_armv7/mkspecs/android-g++ -I../SSLTunnel -I../SSLTunnel/qtquick2applicationviewer -I../../Qt/5.2.1/android_armv7/include -I../../Qt/5.2.1/android_armv7/include/QtQuick -I../../Qt/5.2.1/android_armv7/include/QtQml -I../../Qt/5.2.1/android_armv7/include/QtNetwork -I../../Qt/5.2.1/android_armv7/include/QtGui -I../../Qt/5.2.1/android_armv7/include/QtCore -I. -I../../software/android-ndk-r9d/sources/cxx-stl/gnu-libstdc++/4.8/include -I/Users/derek/software/android-ndk-r9d/sources/cxx-stl/gnu-libstdc++/4.8/libs/default/armeabi-v7a/include -I../../software/android-ndk-r9d/platforms/android-8/arch-arm/usr/include -I. -o main.o ../SSLTunnel/main.cpp
In file included from ../../software/android-ndk-r9d/sources/cxx-stl/gnu-libstdc++/4.8/include/algorithm:60:0,
                 from ../../Qt/5.2.1/android_armv7/include/QtCore/qglobal.h:82,
                 from ../../Qt/5.2.1/android_armv7/include/QtCore/qcoreapplication.h:45,
                 from ../../Qt/5.2.1/android_armv7/include/QtGui/qguiapplication.h:45,
                 from ../../Qt/5.2.1/android_armv7/include/QtGui/QGuiApplication:1,
                 from ../SSLTunnel/main.cpp:1:
../../software/android-ndk-r9d/sources/cxx-stl/gnu-libstdc++/4.8/include/utility:68:28: fatal error: bits/c++config.h: No such file or directory
 #include <bits/c++config.h>

这是什么问题?

2 个答案:

答案 0 :(得分:2)

过去似乎存在已知的缺陷:Issue 35616

另一篇帖子中有评论说如果你运行的是gcc 4.4版,它会起作用: standalone toolchain does not find c++ includes

答案 1 :(得分:0)

我之前遇到过同样的问题。现在我已经解决了。 将这些系统变量添加到系统环境中: ANDROID_HOME:D:/ android_sdk / adt-bundle-windows-x86-20140321 / adt-bundle-windows-x86-20140321 / sdk(你的android sdk)

ANDROID_NDK_HOST:视窗

ANDROID_NDK_PLATFORM:机器人-19

ANDROID_NDK_ROOT:D:\ android_ndk \ android-ndk-r9d-windows-x86 \ android-ndk-r9d(你的android ndk)

ANDROID_SDK_ROOT:D:/ android_sdk / adt-bundle-windows-x86-20140321 / adt-bundle-windows-x86-20140321 / sdk(你的android sdk)

然后重置qt-creator,重建你的程序。