Qt 5.6: QMAKE and CONFIG = C++11 - is it safe to remove this?
After upgrading to Qt 5.6 I was annoyed to learn that CONFIG had C++11 flag set by default. Not only it overrode my
*g++*:QMAKE_CXXFLAGS += -std=c++1y, but also used the gnu version of the standard, which is not what I want.
So, my question is: does this config value change anything else other than the
-std=flag? If yes, how do I get my desired behaviour (compilation in standard-compliant mode with a recent standard, like 14 or 17)?
It is not clear to me: do you mean Qt 5.6 is built with C++11 support or where is this flag set by default?
Did you try CONFIG += c++14?
does this config value change anything else other than the
No, feel free to remove or replace it.
@jsulm Yes I tried C++14 config, it results in
-std=gnu++1ybeing added - not what I want.
And I don't know whether Qt is built with C++11 or not. After switching to the 5.6 kit my project stopped building because
-std=gnu++0xoverrode my flag for
@krzaq I'm surprised anything changed at all with the c++14 flag. Are you using 5.6.0-rc ? In my case
CONFIG += c++11 c++14doesn't seem to do anything at all when compiling to Android. I'm using 5.6.0-rc and with
CONFIG += c++11 c++14I'm just getting
With Qt 5.5.1
CONFIG += c++11 c++14I get
-std=c++1yadded to the mix and I can use relevant functionality (std::make_unique).