I am trying to compile c++11 code on the Mac OS X using Qt Creator/qmake and I am getting the following error:
clang: error: invalid deployment target for -stdlib=libc++ (requires OS X 10.7 or later)
When I checked the compile command line, I noticed that it contains the -mmacosx-version-min=10.6 flag. I tried to update my .pro file as follows, but it seems that this is not taken into account:
QMAKE_CXXFLAGS += -std=c++11 -stdlib=libc++
macx {
-mmacosx-version-min=10.7
}
Any suggestions would be helpful. Thanks!
You can actually add that deployment target line QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.6
to your QMake project file. You don't have to reinstall Qt.
One thing to keep in mind, though: if you build any other libraries that you include in your application bundle, make sure they're also compiled for backwards compatibility! In case it helps with any libraries, there's an equivalent CMake command as well, CMAKE_OSX_DEPLOYMENT TARGET
.