【发布时间】:2015-03-29 03:32:49
【问题描述】:
我在 Mac 上。我将我的 OSx 更新为 Yosemite。我将我的 xcode 更新到版本 6。我下载了命令行工具。
而且,每当我输入 g++ --version 时,我都会得到:
# g++ --version
couldn't understand kern.osversion `14.1.0'
i686-apple-darwin11-llvm-g++-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.11.00)
Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
意思是,我还在用老版本的g++和gcc。
为什么不升级?我对在 Eclipse 中使用 c++0x 很感兴趣,为此我需要一个更新的 g++/gcc 编译器。
编辑:根据下面的评论,我有两个问题:
为什么
$ clang --version
Apple clang version 4.1 (tags/Apple/clang-421.11.66) (based on LLVM 3.1svn)
Target: x86_64-apple-darwin14.1.0
Thread model: posix
我似乎还有旧版本的 clang?
为什么安装 xcode 和命令行工具没有创建到 clang 的正确链接?
【问题讨论】:
-
最新的 osx/xcode 不会安装新的 gcc,它会安装新的 clang 并给它一个 gcc 别名。