【发布时间】:2012-12-07 03:33:33
【问题描述】:
我在 Moutain Lion 上安装了 Xcode 4.5.2,并且安装了最新的“命令行工具”,但是当我尝试使用 g++ 或 clang++(以及选项 -std=c++11 -stdlib=libc++)进行编译时出现错误.
与g++:
cc1plus: error: unrecognized command line option "-std=c++11"
cc1plus: error: unrecognized command line option "-stdlib=libc++"
与clang++:
clang: error: invalid deployment target for -stdlib=libc++ (requires OS X 10.7 or later)
它在一个 Qt 项目中。
那么如何在我的 Mac 上使用 C++11 呢?
【问题讨论】:
-
你需要这个libcxx.llvm.org,它是被标志
-stdlib=libc++调用的llvm项目的c++库 -
谢谢 - 这正是我遇到类似问题所需要的。