How to use C++11 in your Qt Projects: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
[[Category:HowTo]] | |||
[toc align_right="yes" depth="3"] | |||
= | = How to use c+''11 in your qt projects? | ||
<br />At this moment (march 2014) Qt Creator doesn't add the necessary flags for you by default. You have to do it manually. | |||
<br />h2. In your pro file | |||
<br />add :<br /><code>QMAKE_CXXFLAGS''= -std=c+''0x // for GCC < 4.7<br />or<br />QMAKE_CXXFLAGS''= -std=c+''11 // for GCC >= 4.7</code> | |||
<br />or<br /><code>CONFIG''= c++11<code> = | |||
== In Qt Creator build settings == | |||
==In Qt Creator build settings== | |||
you can use the build input fields : | you can use the build input fields : | ||
Project > Build steps > qmake section >additional arguments | Project > Build steps > qmake section >additional arguments | ||
</code>“QMAKE_CXXFLAGS ''= -std=c''+0x”</code> | |||
Don’t forget the “” in the input field. | Don’t forget the “” in the input field. | ||
Revision as of 08:57, 24 February 2015
[toc align_right="yes" depth="3"]
= How to use c+11 in your qt projects?
At this moment (march 2014) Qt Creator doesn't add the necessary flags for you by default. You have to do it manually.
h2. In your pro file
add :
QMAKE_CXXFLAGS''= -std=c+''0x // for GCC < 4.7<br />or<br />QMAKE_CXXFLAGS''= -std=c+''11 // for GCC >= 4.7
or
CONFIG''= c++11<code> =
== In Qt Creator build settings ==
you can use the build input fields :
Project > Build steps > qmake section >additional arguments
“QMAKE_CXXFLAGS = -std=c+0x”
Don’t forget the “” in the input field.