This question already has an answer here:
Where in Qt can I specify additional compiler options? Like for example -std=c++0x?
This question already has an answer here:
Where in Qt can I specify additional compiler options? Like for example -std=c++0x?
The way QT deals with compiler options is through the .pro file. It is a double edged sword if I may. It creates a nice abstraction, especially when compiling large projects. The problem is that you have to either look up or memorize how to add the flag. In the case of C++0X, you have to add the following flag to your .pro file:
Fortunately most of the flags that you need are automatically added if you use QtCreator.
In your .pro file, you could add:
I think every variable in the spec's
qmake.conf
can be altered like that.For example, the win32-g++ spec has, among other variables, these:
You can try adding
to your .pro file.
However, this should not be used in Qt 5 for enabling specific c++ standard. Instead,
c++11
orc++14
inCONFIG
variable to do that. It will enable GNU extensions (-std=gnu++11), but if that is unwanted, also addstrict_c++
if you want to disable those. For example, this should pass-std=c++11
to the compiler: