Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.6k views
in Technique[技术] by (71.8m points)

c++ - clang++: error: linker command failed with exit code 1 Qt Android

Unable to build Qt examples . Getting error while building in windows

 E:android-ndk-r20-windows-x86_64android-ndk-r20/toolchains/aarch64-linux- 
 android-4.9/prebuilt/windows-x86_64/lib/gcc/aarch64-linux- 
 android/4.9.x/../../../../aarch64-linux-android/binld: cannot find -lc++
 clang++: error: linker command failed with exit code 1 (use -v to see 
 invocation)
  make: *** [libanalogclock.so] Error 1

Qt SDK and NDK configuration

enter image description here

Qt version

enter image description here

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

The error: cannot find -lc++ using ndk r20 can be solved like this: https://codereview.qt-project.org/c/qt/qtbase/+/264903/9/mkspecs/android-clang/qmake.conf#34

For example to compile for android armv7 ndk r20, locate the file: C:Qt5.13.0android_armv7mkspecsandroid-clangqmake.conf and add the missing -nostdlib++ for android x86 (i use this for emulator), locate the file: C:Qt5.13.0android_x86mkspecsandroid-clangqmake.conf


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...