2

I can not create an APK with Qt creator, I can launch the application in the emulator but cannot build APK

I followed this tutorial to install qt and install qt creator with the offline package : https://wiki.qt.io/Android https://doc.qt.io/qt-5/deployment-android.html

I intall Clang-8 and GCC-8 and others dependencies for qt (like mesa-common-dev, libglu1-mesa-dev...)

I tried to build these applications i have sames issue - https://github.com/ekke/c2gQtCon_x - https://github.com/ekke/c2gQtWS_x (with : https://github.com/ekke/statusbar) - Somes Exemples (like Qt SCXML Calculator)

Qt output these errors:

/home/bensuperpc/android-ndk-r20/toolchains/x86_64-4.9/prebuilt/linux-x86_64/lib/gcc/x86_64-linux-android/4.9.x/../../../../x86_64-linux-android/bin/ld: error: cannot find -lc++
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [libbt_le_x.so] Error 1
15:22:48: Le processus "/home/bensuperpc/android-ndk-r20/prebuilt/linux-x86_64/bin/make" s'est terminé avec le code 2.
Erreur lors de la compilation/déploiement du projet bt_le_x (kit : Android for x86_64 (Clang Qt 5.13.0 for Android x86_64))
When executing step "Make"

You can see Qt Creator output (image) : https://drive.google.com/file/d/1lRe1Xs65EDs8aXZqFEbAxh8htjziQRRW/view?usp=sharing

Edit : i change API level 18 to 21 in these applications and i work with Qt5.13 and android NDK 20 on kubuntu 19.04

I solve my issue with this solution : - I add -nostdlib++ in qmake.conf

https://codereview.qt-project.org/c/qt/qtbase/+/264903/9/mkspecs/android-clang/qmake.conf#34

Bensuperpc
  • 1,275
  • 1
  • 14
  • 21
  • Odd, you have a working C++ compiler that fails to link to the STL library. Have you verified you can run the compiler using the command line to compile and run a small application ? Also, in qt creater there is a window where you can manage your project configuration, compiler, qt library... If there is a problem it is usually flagged. – Arne J Jun 22 '19 at 08:12
  • I remember, it is called a 'kit' in Qt Creator. Find the 'Manage kits' window, see if there's anything wrong. – Arne J Jun 22 '19 at 08:16
  • @ArneJ I can compile and execute these applications in emulator to i can build APK, you talk about my Qt config ? i upload images : https://drive.google.com/open?id=1nFpajqDdH6Jogq89h8aGYFu275nxt7mx you can see nothing wrong or or that is not indicated ? – Bensuperpc Jun 22 '19 at 08:20

0 Answers0