我在 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 编译器。
编辑:根据下面的评论,我有两个问题:
Why
$ 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 链接?
看起来您可能还安装了旧版本的 xcode。
从命令行您可以切换到正确的命令行
xcode-select --switch <path>
你应该看到这样的东西
$ g++ --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr/include/c++/4.2.1
Apple LLVM version 6.0 (clang-600.0.56) (based on LLVM 3.5svn)
Target: x86_64-apple-darwin14.1.0
Thread model: posix
$ clang --version
Apple LLVM version 6.0 (clang-600.0.56) (based on LLVM 3.5svn)
Target: x86_64-apple-darwin14.1.0
Thread model: posix
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)