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

Setting QtCreator compiler build flags when using cmake, gcc on linux -std=c++14



  • This question is asked many times on stackoverflow but there no good and specific answers that I can find there or here. Can't find any reference in the Qt manuals either. Where exactly should I look in the documentation it it exists?

    Presuming there is no documentation :(, here is what I've done:
    Built a 'non-Qt project/plain c++ application' project using CMake with a custom 'kit' using QtCreator.

    The custom kit consists of a 'Desktop Qt 5.5.1 GCC 64bit2' with a custom compiler.

    The custom compiler consists of a 'clone' of the auto-detected GCC X86 64bit and invokes /usr/bin/g++ using an x86-linux-generic-elf-64bit ABI. I get a compiler error when I build from the IDE saying that some of my code is not supported in c++98. I can build and run using old syntax, but when I use c++14 syntax, I get compiler errors due to the lack of the -std=c++14 flag on the gcc (5.3.1) invocation.

    In hopes of making it work I put "-std=c++14" in the 'Platform codegen flags' text box. It appears to have no effect.

    Thanks in advance for any help.


  • Lifetime Qt Champion

    Hi and welcome to devnet,

    Just to be sure are you using CMake or qmake for handle your project ?

    If CMake then this page might be of use.

    Hope it helps


Log in to reply