[Interest] How best to turn on "-std=gnu++11" when using qmake to build a project?

K. Frank kfrank29.c at gmail.com
Wed Apr 17 00:17:34 CEST 2013


Hello List!

When I am using qmake to build a project that uses Qt, what is the best
way to turn on the compiler flag "-std=gnu++11"?  (I am using a mingw-w64
build of g++ 4.8.1.)

Ideally, I would like to do this on a "global" basis, and not have to do it for
each project separately (but that's not essential).

(I had started out by building Qt with "-std=gnu++11", hoping, but not
testing or otherwise confirming, that "-std=gnu++11" would somehow
get baked into qmake and end up in the makefiles it generates.  But,
as detailed in an earlier thread, my current plan is not to configure /
build Qt with "-std=gnu++11".)

My overall goal is to use c++11 features in my code, including in Qt-based
projects.  So when my code gets compiled, ultimately driven by the qmake
system, the "-std=gnu++11" flag needs to be specified on the g++ command
lines.

Thanks for any suggestions.


K. Frank



More information about the Interest mailing list