配置Qt Creator使用Clang和Qt for Android

Jac*_*ieg 6 qt android gcc android-ndk qt5

它似乎已GCC被弃用,将从Android NDK中删除 ; Clang将被用来代替.话虽如此,Android NDK将永远不会得到支持,也不会有GCC 5任何更新GCC.

话虽这么说,我想用Qt for AndroidClang,似乎工作已经在这个方向上已经做了Qt 5.7.1:https://bugreports.qt.io/browse/QTBUG-50724,但我不知道如何配置Qt Creator使用ClangAndroid配置和Qt Creator不自动检测配置:

在此输入图像描述

有谁知道如何配置Qt CreatorClang编译器的Android位置?似乎他们在某处,/Users/user/Library/Android/sdk/ndk-bundle/但我似乎无法做到正确.我用Qt Creator 4.2.2.

是否有可能使用Qt for AndroidClang

小智 3

我在手动添加 C 和 C++ clang 编译器方面取得了一些成功。

编译路径:/home/david/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++

平台代码生成标志:-target armv7-none-linux-androideabi

您将需要以同样的方式构建 Qt!我的配置命令是:

export OPENSSL_LIBS='-L/home/david/QtAndroidBuild/OpenSSL/libs/armeabi-v7a/lib -lssl -lcrypto'
./configure -xplatform android-clang \
    --disable-rpath \
    -nomake tests \
    -nomake examples \
    -android-ndk /home/david/Android/Sdk/ndk-bundle \
    -android-sdk /home/david/Android/Sdk \
    -android-ndk-host linux-x86_64 \
    -android-toolchain-version 4.9 \
    -android-arch armeabi-v7a \
    -android-ndk-platform android-19 \
    -skip qttranslations \
    -skip qtserialport \
    -skip qt3d  \
    -skip qtcharts \
    -skip qtdoc \
    -skip qtmultimedia \
    -openssl-linked \
    -no-warnings-are-errors \
    -opensource \
    -confirm-license  \
    -I /home/david/QtAndroidBuild/OpenSSL/libs/armeabi-v7a/include \
    -prefix /home/david/apps/QtAndroidClang \
    -recheck
Run Code Online (Sandbox Code Playgroud)

您可能不需要/不想要 OpenSSL,因此请根据需要进行调整。我构建5.10.1。