我在Mountain 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?