3

我正在尝试运行我的第一个Qt Android应用程序,并按照本教程进行操作:

http://urfoex.blogspot.ro/2013/12/qt5-android-setting-up-qt-52-for-android.html

但是,在我运行它之后,我得到了这个错误:

i686-linux-android-g++: error: unrecognized command line option '-marm' make: *** 
[main.o] Error 1 21:33:42: The process "make" exited with code 2.
Error while building/deploying project avd_tests (kit: Android for x86 (GCC 4.8, Qt 5.2.1)) When executing step 'Make'

我也尝试过使用armeabi,但我得到了:

In file included from ../.android-ndk/sources/cxx-stl/gnu-libstdc++/4.8/include/algorithm:60:0,
                 from ../.Qt5.2.1/5.2.1/android_armv7/include/QtCore/qglobal.h:82,
                 from ../.Qt5.2.1/5.2.1/android_armv7/include/QtCore/qcoreapplication.h:45,
                 from ../.Qt5.2.1/5.2.1/android_armv7/include/QtWidgets/qapplication.h:45,
                 from ../.Qt5.2.1/5.2.1/android_armv7/include/QtWidgets/QApplication:1,
                 from ../avd_tests/qtquick2controlsapplicationviewer/qtquick2controlsapplicationviewer.h:13,
                 from ../avd_tests/main.cpp:1: ../.android-ndk/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>
                            ^ compilation terminated. make: *** [main.o] Error 1 21:44:14: The process "make" exited with code 2. Error while building/deploying project avd_tests (kit: Android for armeabi-v7a (GCC 4.8, Qt 5.2.1)) When executing step 'Make'

我正在构建的应用程序是默认Qt Quick应用程序。我正在使用Qt 5.2.1QtCreator 3.0.1

任何人都知道它可能是什么,或者有人知道如何进行工作的好Qt指南AndroidGNU/Linux

4

2 回答 2

2

You should download and install Qt 5.2.1 for Android (Linux 32-bit or 64-bit) from here. Qt Project’s SDK is not coming with Android SDK/NDK so you must download and install them yourself from here. You’ll need Android NDK (ver. r9+) and SDK (ver. 22+).

If you don’t plan to create Android Java apps, then make sure you are downloading ONLY the SDK and not ADT Bundle or Android Studio.

After downloading extract them. For Android SDK you should have a connection to Internet and download the desired tools. you have to install at least Android API-13! You also must install Android SDK Platform-tools and Android SDK Build-tools.

Open Qt Creator. Goto Tools->Option->Android settings page and set Android SDK and NDK locations.

You can find a detailed tutorial Here.

于 2014-04-09T03:42:01.697 回答
2

事实证明,这是较新版本的Android SDK.

正如的创建者Bogdan Vatra所指出的Qt for Android,解决方案是:

  • 查找较旧的 Android SDK。
  • 升级您的 Qt 创建者(使用 Qt SDK 5.3)
  • 使用真实设备。

为了解决我qt-opensource-linux-x64-android-5.3.0-RC_2014-04-14_00-48-35-55.runhttp://download.qt-project.org/snapshots/qt/5.3/5.3.0-RC/2014-04-14_55/下载的问题,部署成功!

谢谢博格丹!

于 2014-04-14T15:39:20.677 回答