Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. fatal error: 'type_traits' file not found
Forum Updated to NodeBB v4.3 + New Features

fatal error: 'type_traits' file not found

Scheduled Pinned Locked Moved Solved Mobile and Embedded
6 Posts 4 Posters 16.5k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • O Offline
    O Offline
    Oshio
    wrote on last edited by Oshio
    #1

    When I try to build any Project with Android Kit, I receive the following error at the output:

    /opt/Qt/5.12.0/android_armv7/include/QtCore/qglobal.h:45:12: fatal error: 'type_traits' file not found
    

    This happens with every Android Kit.

    In Qt Creator, looking at Options -> Devices -> Android, Android Settings display two error messages:

    • X Android NDK directory structure is correct;
    • X Android NDK installed into a path without spaces;

    This is the content inside the NDK directory, /opt/android-studio/android-ndk-r18b:

    .
    ├── build
    ├── meta
    ├── prebuilt
    ├── python-packages
    ├── shader-tools
    ├── simpleperf
    ├── sysroot
    ├── toolchains
    └── wrap.sh
    

    I can build Desktop projects successfully.

    Info:

    • Ubuntu 18.04;
    • Qt 5.12.0;
    • Qt Creator 4.8;
    aha_1980A 1 Reply Last reply
    0
    • O Oshio

      When I try to build any Project with Android Kit, I receive the following error at the output:

      /opt/Qt/5.12.0/android_armv7/include/QtCore/qglobal.h:45:12: fatal error: 'type_traits' file not found
      

      This happens with every Android Kit.

      In Qt Creator, looking at Options -> Devices -> Android, Android Settings display two error messages:

      • X Android NDK directory structure is correct;
      • X Android NDK installed into a path without spaces;

      This is the content inside the NDK directory, /opt/android-studio/android-ndk-r18b:

      .
      ├── build
      ├── meta
      ├── prebuilt
      ├── python-packages
      ├── shader-tools
      ├── simpleperf
      ├── sysroot
      ├── toolchains
      └── wrap.sh
      

      I can build Desktop projects successfully.

      Info:

      • Ubuntu 18.04;
      • Qt 5.12.0;
      • Qt Creator 4.8;
      aha_1980A Offline
      aha_1980A Offline
      aha_1980
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @Oshio said in fatal error: 'type_traits' file not found:

      In Qt Creator, looking at Options -> Devices -> Android, Android Settings display two error messages:

      X Android NDK directory structure is correct;
      X Android NDK installed into a path without spaces;

      That does not really look like error messages, I guess they have a green checkmark?!

      type_traits is a header for the C++ standard library.

      • Which compiler (and version) are you using for Android?
      • Do you have a type_traits header file for that compiler?

      Qt has to stay free or it will die.

      O 1 Reply Last reply
      0
      • aha_1980A aha_1980

        @Oshio said in fatal error: 'type_traits' file not found:

        In Qt Creator, looking at Options -> Devices -> Android, Android Settings display two error messages:

        X Android NDK directory structure is correct;
        X Android NDK installed into a path without spaces;

        That does not really look like error messages, I guess they have a green checkmark?!

        type_traits is a header for the C++ standard library.

        • Which compiler (and version) are you using for Android?
        • Do you have a type_traits header file for that compiler?
        O Offline
        O Offline
        Oshio
        wrote on last edited by
        #3

        @aha_1980 said in fatal error: 'type_traits' file not found:

        That does not really look like error messages, I guess they have a green checkmark?!

        Unfortunately they have a red X at the side.

        I'm using clang 7.02.
        Looking at clang include directory I couldn't find any type_traits.h

        1 Reply Last reply
        0
        • B Offline
          B Offline
          biskero
          wrote on last edited by biskero
          #4

          Hello,

          I just updated to the latest Qt release and I am getting the same error:
          ../../../../Qt/5.12.1/android_armv7/include/QtCore/qglobal.h:45:12: fatal error: 'type_traits' file not found

          include <type_traits>

          compiling on macOS for Android build NDK 19b and SDK 28
          Qt Creator 4.8.1 Based on Qt 5.12.0 (Clang 10.0 (Apple), 64 bit)

          any help?
          Thx

          1 Reply Last reply
          0
          • A Offline
            A Offline
            Anton Ti
            wrote on last edited by
            #5

            Any success with this?

            1 Reply Last reply
            0
            • O Offline
              O Offline
              Oshio
              wrote on last edited by Oshio
              #6

              @Anton-Ti @biskero
              The root of all this trouble were two silly mistakes when unzipping the downloaded ndk.

              1. The first error is the one that motivated me to post this question and is related with my low end computer and my Ubuntu 18.04. When unzipping files, the OS doesn't provides any message warning me that the process has finished. My computer takes ~2 min to complete the extraction, so my guess is that I did a copy and paste of the folder before all the files were extracted.

              After taking notice from this fact and downloaded again the ndk, but I was getting the same errors, although I was sure the extraction was successful. And here is the another silly mistake:

              1. When unzipping the ndk, a folder is created, which contains another folder with nearly identical name, here's the structure:

                ...android-ndk-r19c-linux-x86_64/android-ndk-r19c/

                In the Qt Creator I was providing the path to ...android-ndk-r19c-linux-x86_64/ and not to ...android-ndk-r19c-linux-x86_64/android-ndk-r19c/, after altering to the correct path everything worked fine.

              Important Note: From Qt5.12 forward, is recommended to use the latest ndk version.

              1 Reply Last reply
              4

              • Login

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Users
              • Groups
              • Search
              • Get Qt Extensions
              • Unsolved