Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-76787

Android building, cannot find -lc++

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • Not Evaluated
    • None
    • 5.12.1, 5.13.0
    • Build System
    • None
    • Qt creator 4.9.1 based on Based on Qt 5.12.3 (GCC 5.3.1 20160406 (Red Hat 5.3.1-6), 64 bit)

      Windows 10 1803 and Ubuntu 19.04
      Android SDK Version: 26.1.1
      NDK Version: 20.0.5594570
    • Android

    Description

      Problem
      Taking any example project and attempting to build it for Android from a fresh install with the latest versions is not working. 

      Error during linking for default kits:
      Android for arm64-v8a (Clang Qt 5.13.0 for Android ARM64-v8a)
      Android for armeabi-v7a (Clang Qt 5.13.0 for Android ARMv7)

      The following error occurs: 
      /home/joxye/Android/Sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld: error: cannot find -lc++

      Background
      Initially received this error on Windows and thought it was specific to Windows. So I created an Ubuntu VM to test it out a bit more. After setting up Qt/Qt-Creator and Android (SDK+NDK and JDK) I got the exact same error. I am guess this is due to changes in the NDK as hinted to [here|https://github.com/android-ndk/ndk/issues/951]

      As per the link, adding -nostdlib++ to ANDROID_CXX_STL_LIBS seam to fix the issue, obviously there might be more it than that.  

      Tested with the Qt-example project's included with Qt-creator. 

      Additional information:
      files are here:

      Qt/5.13.0/android_armv7/mkspecs/android-clang/qmake.conf
      Qt/5.13.0/android_arm64_v8a/mkspecs/android-clang/qmake.conf

      Only changed line 48: (like this)
      ANDROID_CXX_STL_LIBS = $$ANDROID_SOURCES_CXX_STL_LIBDIR/libc+.so.$$replace(ANDROID_PLATFORM, "android-", "") -nostdlib++

      Not sure if this is a problem for Android for x86/x86_64 (I haven't tested that) 

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              qtbuildsystem Qt Build System Team
              joxye Johan Lindström
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes