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

為{幸葍}努か 提交于 2021-02-10 06:52:38

问题


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

 E:\android-ndk-r20-windows-x86_64\android-ndk-r20/toolchains/aarch64-linux- 
 android-4.9/prebuilt/windows-x86_64/lib/gcc/aarch64-linux- 
 android/4.9.x/../../../../aarch64-linux-android/bin\ld: 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

Qt version


回答1:


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:\Qt\5.13.0\android_armv7\mkspecs\android-clang\qmake.conf and add the missing -nostdlib++ for android x86 (i use this for emulator), locate the file: C:\Qt\5.13.0\android_x86\mkspecs\android-clang\qmake.conf




回答2:


According to this page installing ndk version 19 should fix it. Did it for me.



来源:https://stackoverflow.com/questions/56713738/issues-to-build-apk-with-qt-creator

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!