-std=c++11 with Xcode 4.6

Started by
2 comments, last by FGFS 8 years, 10 months ago

Hi

how/where to set -std=c++11 in xcode 4.6? My code compiles on Ubuntu/Eclipse with that and also on Win8.1 but I cannot find where

to set that in xcode.

Thanks

Advertisement

Not sure whether Xcode 4.6 already supports C++11; you should consider to switch to a 5.x version.

However, when you open the "Build Settings" for a target, then search for the fields "C++ Language Dialect" and then "C++ Standard Library" and pick the C++11 option that suit your needs. If the options do not provide some "C++11" and/or "GNU++11" stuff, then you need to upgrade Xcode, of course.

XCode supports C++11 just fine, you just have to find the proper switches. If you click on your target to get the build settings, select 'Levels' and look for the section named 'Apple LLVM 6.1 - Language - C++', under that you can change the Dialect to C++11 and then Standard Library to 'libc++'. Those two changes should take care of what you need. A note: the location may have changed since 4.6, I don't have that old of a machine to check exactly, but it was basically the same.

Thanks. Lucky me, I had a 5.02 already downloaded years ago. The apple developer download seems down and I won't create a apple store id.

This topic is closed to new replies.

Advertisement