[转]Xcode中C++ Standard Library的选择

http://blog.csdn.net/tangaowen/article/details/8648990

如果你在 summary 中 的Deployment  Target 中选择了4.3,而不是XCode默认的6.0,那么你在 混编C++的时候还可能会遇到另外一个错误:

 

clang: error: invalid deployment target for -stdlib=libc++ (requires iOS 5.0 or later)

clang failed with exit code 1

原因是 XCode 的 Build Setting中 的 C++  Standard  Library默认选择了 

libc++ (LLVM C++ standard library with c++11 support)选项,这个表示支持c++11的最新特新,

但是它只支持ios5以上,所以如果要使用这个选项,有两个选择:

    第1个选择就是 将Deployment Target中 改为5.0以上,一般不会这样,因为我们一般想支持的sdk越低越好,尽量支持低版本的ios设备。

    第2个选择就是 将这个 C++ Standard Library选项改为 libstdc++ (GNU  c++  standard  library ),它支持最低到4.3 .

posted @ 2014-07-24 10:50  One Leaf  阅读(1807)  评论(0编辑  收藏  举报