Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Cannot build qt on linux with libc++ stdlib. fatal error: 'type_traits' file not found



  • I'm trying to build qt from sources with that command:

    ./qt5/configure \
    -platform linux-clang-libc++ \
    QMAKE_CC="clang-9" \
    QMAKE_LINK_C="clang-9" \
    QMAKE_LINK_C_SHLIB="clang-9" \
    QMAKE_CXX="clang++-9" \
    QMAKE_LINK="clang++-9" \
    QMAKE_LINK_SHLIB="clang++-9" \
    QMAKE_CXXFLAGS+="-ftemplate-depth=1024"
    

    But it fails with that output

    Performing shadow build...
    Preparing build tree...
    Creating qmake...
    In file included from /home/user/conan/qt/5.15.2/my/my/source/qt5/qtbase/qmake/main.cpp:30:
    In file included from /home/user/conan/qt/5.15.2/my/my/source/qt5/qtbase/qmake/project.h:32:
    In file included from /home/user/conan/qt/5.15.2/my/my/source/qt5/qtbase/qmake/library/qmakeevaluator.h:36:
    In file included from /home/user/conan/qt/5.15.2/my/my/source/qt5/qtbase/qmake/library/qmakeparser.h:32:
    In file included from /home/user/conan/qt/5.15.2/my/my/source/qt5/qtbase/qmake/library/qmake_global.h:32:
    In file included from /home/user/conan/qt/5.15.2/my/my/source/qt5/qtbase/include/QtCore/qglobal.h:1:
    /home/user/conan/qt/5.15.2/my/my/source/qt5/qtbase/include/QtCore/../../src/corelib/global/qglobal.h:45:12: fatal error: 'type_traits' file
          not found
    #  include <type_traits>
               ^~~~~~~~~~~~~
    1 error generated.
    

    I have installed libc++-9-dev and libc++abi-9-dev in my system. Path /usr/lib/llvm-9/include/c++/v1/ contains all standard lib headers (type_traits too of course). When I compiled other projects with -v flag, the path above was in the list of compiler search paths. I tried to add the same option with QMAKE_CXXFLAGS and CXXFLAGS but it doesn't "see" that. I also tried to add -I option with that path to ./configure call (as its help states it adds include search path). And I also tried to define environment variables INCLUDE and INCLUDEPATH but configure doesn't use them. All three approaches do the same thing - nothing, output is still the same


Log in to reply