Osx Lion: Xcode 4.1 how do I setup a c++0x project

后端 未结 1 1331
礼貌的吻别
礼貌的吻别 2020-12-30 14:26

I know there have been other questions like that but (i.e. Can I use C++11 with Xcode?) but mostly related to older versions of Osx or xcode so they don\'t really seem to be

相关标签:
1条回答
  • 2020-12-30 14:38

    In Xcode 4.1 you can use the 'other' flags to get access to the compiler's C++0x support, such as it is (Actually I'm not sure what level it's at right now, and I can't check it right now). The latest version of clang have much better support than the version that was shipped with Xcode 4.1. Xcode 4.2 should have the updated compiler and added language and library selection options.

    So, to get C++0x support in Xcode 4.1 add the flags -std=c++0x -stdlib=libc++ to the compiler and -stdlib=libc++ to the linker. You might also need -U__STRICT_ANSI__ on the compiler (apparently if __STRICT_ANSI__ is defined it triggers a bug in the system headers).

    0 讨论(0)
提交回复
热议问题