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

Android NDK unordered_map cmath header has no member named 'isless' and more



    • Bug
    • Resolution: Invalid
    • P2: Important
    • None
    • 5.11, 5.12
    • Extras: Android
    • None
    • Android


      We are about to release a new RetroShare version and I am preparing the build of RetroShare "daemon" as an Android service for this version too (we have it working for last version we released), but the new RetroShare version depends on some more libraries that need modern C++ support and do not compile with NDK older then 17c (both 17c and 18 compile the libraries fine but 16b and older miss some C++ bits), this means that we need to use clang as compiler as GCC is missing or broken on those NDK, so I have successfully compiler Qt 5.12 from git repository with this instructions


      git clone git://code.qt.io/qt/qt5.git
      cd qt5
      perl init-repository -f --module-subset=essential,qtandroidextras,qtquickcontrols2,qtsvg
      git checkout 5.12
      git submodule update --recursive
      ./configure -platform linux-clang -xplatform android-clang --disable-rpath -nomake tests -nomake examples -android-ndk /opt/android-ndk/ -android-ndk-platform android-21 -android-toolchain-version 4.9 -android-sdk /opt/android-sdk-update-manager/ -android-ndk-host linux-x86_64 -skip qttranslations -skip qtserialport -no-warnings-are-errors -prefix /opt/Qt-5.12.0 -opensource -confirm-license -c++std c++14 -no-openssl
      gmake -j$(nproc)
      sudo gmake install


      Strangely i need to add this -android-toolchain-version 4.9 (that is GCC EABI version) while I would expect that is not needed because i am building with clang otherwise configure fail saying I should specify -android-toolchain-version on the command line, anyway looking at the compile log clang is effectively used, so i didn't bothered too much about that...

      Then on QtCreator I have added that Qt version and create the kit with appropriate compiler etc (I have also selected android platform 21 everywhere including in the project page, on the build apk tab and in the android manifest) but then attempting to build the application get a huge amount of errors into the android NDK headers as you can see in the failed-build.log attachment or here https://paste.kde.org/p9ewykuxr#line-965 too


      A part from all the fatal error reported on NDK headers that breaks compilation i see this unexpected things in the log:


      -D_ANDROID_API_=16 is specified while I have specified 21 anywhere i could...


      -gcc-toolchain /opt/android-ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64

      Is this -gcc-toolchain needed with clang? and what sense it make especially on NDK 18 which release notes says GCC has been removed?


      shouldn't it be -std=c++14 ?

      And does gnu+14 make sense with clang? and on an NDK without GCC ? Anyway after the test reported here I made more doing also some trickery in qmake spec files to force it to use -std=c14 but i obtained same identical error(except for -std=c14 being used in commands instead of -std=gnu+14 )... so it doesn't seems the source of the problem...

      I have looked a lot on the internet for similar error but didn't find much on how to solve this...

      In the IRC channels someone suggested to use cmake instead of qmake but it is not viable for me now as we have a big codebase that uses qmake and then someone else pointed out that cmake could be affected by similar issue with android and clang I post the link here as it may be useful for someone that has deeper knowledge https://github.com/android-ndk/ndk/issues/452#issuecomment-314805599


      Thanks for caring!


        1. failed-build.log
          162 kB
        2. failed-build-21.log
          768 kB

        Issue Links

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



              taipan BogDan Vatra
              g10h4ck Gioacchino Mazzurco
              0 Vote for this issue
              4 Start watching this issue



                Gerrit Reviews

                  There are no open Gerrit changes