You may find it tempting to insert the specific flag (which you mention)
QMAKE_CXXFLAGS += -std=c++11
in your .pro file, but this will insert just that flag on your behalf.
That's insufficient. The right way is to insert instead
CONFIG += c++11
in your .pro file. Two or three necessary changes are then made by qmake
:
-std=c++11
is inserted.-stdlib=libc++
is inserted.- If you're on a Mac,
-mmacosx-version-min=10.6
becomes-mmacosx-version-min=10.7
. (Perhaps some similar change is necessary on other OSes or OS versions.)