Daily Latest Tech Update

How to fix cannot find -lc++ in Qt

  • Share

I want to make another application using Qt to build Android app and getting the error:

C:\Android\sdk\ndk-bundle/toolchains/llvm/prebuilt/windows-x86_64/bin/clang++ -D__ANDROID_API__=21 -target aarch64-none-linux-android -gcc-toolchain C:\Android\sdk\ndk-bundle/toolchains/aarch64-linux-android-4.9/prebuilt/windows-x86_64 -fno-limit-debug-info -Wl,--exclude-libs,libgcc.a -Wl,--exclude-libs,libatomic.a --sysroot=C:\Android\sdk\ndk-bundle/platforms/android-21/arch-arm64/ -Wl,-soname, -Wl,-rpath=C:/Qt/5.12.3/android_arm64_v8a/lib -Wl,--no-undefined -Wl,-z,noexecstack -shared -o main.obj qrc_qml.obj -LC:/Qt/5.12.3/android_arm64_v8a/lib -lQt5Quick -LC:\Qt\5.12.3\android_arm64_v8a/lib -Lc:\Utils\Android\android-ndk-r18b/sources/cxx-stl/llvm-libc++/libs/arm64-v8a -lQt5Gui -lQt5Qml -lQt5Network -lQt5Core -lGLESv2 -LC:\Android\sdk\ndk-bundle/sources/cxx-stl/llvm-libc++/libs/arm64-v8a C:\Android\sdk\ndk-bundle/sources/cxx-stl/llvm-libc++/libs/arm64-v8a/ -llog -lz -lm -ldl -lcC:\Android\sdk\ndk-bundle/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: *** [] Error 103:24:10: The process "C:\Android\sdk\ndk-bundle\prebuilt\windows-x86_64\bin\make.exe" exited with code 2.Error while building/deploying project android-e (kit: Android for arm64-v8a (Clang Qt 5.12.3 for Android ARM64-v8a))When executing step "Make"

It is complaining about missing lc++ library. After doing some research i finally resolve the problem.

The error: cannot find -lc++ using ndk r20 can be solved like this:

For example to compile for android armv7 ndk r20, locate the file:
and add the missing -nostdlib++
for android x86 (i use this for emulator), locate the file:

Hope it’s help you with the same problem when you building an application using Qt.

Originally posted 2019-07-20 17:00:00.

See also  Fixing No default repositories in Qt Maintenance Tool
  • Share

Leave a Reply

Your email address will not be published.