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

Building Qt 5.15.2, -c++std c++14 actives C++17 support



  • Hello,
    I'm trying to build Qt 5.15.2 on CentOS 7 + GCC 8.3.1 without C++17 but C++14 support. Running something like:

    ./configure -opensource -confirm-license -release -shared -R \$ORIGIN -c++std c++14 ...
    

    Ends-up generating build configuration like:

    Configure summary:
    
    Build type: linux-g++ (x86_64, CPU features: mmx sse sse2)
    Compiler: gcc 8.3.1
    Configuration: sse2 aesni compile_examples enable_new_dtags largefile precompile_header rdrnd shani sse3 ssse3 sse4_1 sse4_2 x86SimdAlways shared shared rpath release c++11 c++14 c++17 concurrent dbus reduce_exports reduce_relocations stl
    Build options:
      Mode ................................... release
      Optimize release build for size ........ no
      Building shared libraries .............. yes
      Using C standard ....................... C11
      Using C++ standard ..................... C++17
    ...
    

    Indeed, GCC 8 supports C++17 but I need a C++14 build and it seems like the -c++std c++14 flag does not restrict le standard level here...
    Any idea how I can get Qt's build system to enforce a C++ standard level ?
    Thanks!


  • Lifetime Qt Champion

    @mblanchard said in Building Qt 5.15.2, -c++std c++14 actives C++17 support:

    but I need a C++14 build

    What do you think is different when you build Qt without c++17? The API is the same...



  • Agreed, but my problem is that the C++17 binaires seems to have a versioned sized delacollators (_ZdlPvm@@Qt5) that the C++14 has not.


  • Lifetime Qt Champion

    But how should this be a problem? Do you want to move the compiled binaries to another system? When using the same gcc and linker and compile a program with c++14 on the same system I don't see why it should not work.


  • Lifetime Qt Champion

    If you really want to disable it you can at least modify configure.json and remove c++17 from the section "cxx17" / "qmake"



  • Ok thanks I'll try that!


Log in to reply