Android   发布时间:2022-04-28  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了如何为Android搭建Qt5?大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
我有一台运行Ubuntu 12.04 LTS的服务器.

我想把服务器用于构建Qt5 for Android ARMv6平台.在无头服务器上如何做到这一点?

解决方法

在Ubuntu 12.04 LTS上为Android编译Qt5所需的步骤如下所述.为了方便起见,我将假设以下所有命令都在目录/ opt / qt5-android中运行.如果不是这样,您将需要相应地调整路径.

>首先,您需要确保安装相应的软件包:

sudo apt-get install build-essential openjdk-6-jdk

>获取最新的Android SDK:

wget http://dl.google.com/android/android-sdk_r21.1-linux.tgz
tar -xf android-sdk_r21.1-linux.tgz

> SDK不附带任何平台,因此您需要抓住它们:

android-sdk-linux/tools/android update sdk --no-ui

>获取最新版本的NDK:

32位(i686):

wget http://dl.google.com/android/ndk/android-ndk-r8e-linux-x86.tar.bz2
tar -xf android-ndk-r8e-linux-x86.tar.bz2

64位(amd64):

wget http://dl.google.com/android/ndk/android-ndk-r8e-linux-x86_64.tar.bz2
tar -xf android-ndk-r8e-linux-x86_64.tar.bz2

>现在克隆以下Git仓库:

git clone git://gitorIoUs.org/qt/qt5.git qt5
cd qt5
perl init-repository --no-webkit

>我们几乎在那里现在我们需要配置和制作Qt5:

./configure \
    -developer-build \
    -xplatform android-g++ \
    -nomake tests \
    -nomake examples \
    -android-ndk /opt/qt5-android/android-ndk-r8e \
    -android-sdk /opt/qt5-android/android-sdk-linux \
    -skip qttools \
    -skip qttranslations \
    -skip qtwebkit \
    -skip qtserialport \
    -skip qtwebkit-examples-and-demos
make

就是这样!您现在应该可以使用Android的Qt5版本.

文献:

> Building Qt5 for Android
> Is there a way to automate the android sdk installation?

大佬总结

以上是大佬教程为你收集整理的如何为Android搭建Qt5?全部内容,希望文章能够帮你解决如何为Android搭建Qt5?所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。