xcode 为什么我不能在 OS X 上检查我的 GCC 编译器版本

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/20171095/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 04:20:35  来源:igfitidea点击:

Why can't I check my version of GCC compiler on OS X

xcodemacosgcc

提问by Kris

I typed this in my terminal:

我在终端中输入:

llvm-gcc --version

llvm-gcc --version

But what I have is this :

但我所拥有的是:

Apple LLVM version 5.0 (clang-500.2.79) (based on LLVM 3.3svn)
Target: x86_64-apple-darwin13.0.0
Thread model: posix`

Am I not able to interpret this block of statements? or did I forget to enable something on my system?

我不能解释这块语句吗?还是我忘记在我的系统上启用某些功能?

回答by duskwuff -inactive-

Nothing is wrong. The situation is just a little confusing.

没有错误。情况只是有点混乱。

Apple no longer distributes GCC with Xcode. They now use Clangas the default (and only!) compiler on Mac OS X. cc, gcc, and clang(as well as the C++ variants, c++, g++, and clang++) are now all linked to run clang under current versions of Xcode.

Apple 不再随 Xcode 分发 GCC。他们现在使用Clang作为 Mac OS X 上的默认(也是唯一的!)编译器。ccgccclang(以及 C++ 变体c++g++、 和clang++)现在都链接到在当前版本的 Xcode 下运行 clang。

The version of clang you're running is, per the --versionoutput, 500.2.79.

根据--version输出,您正在运行的 clang 版本是500.2.79。

If you want to install GCC as an alternative to clang, you can do so using a variety of methods, including one using Homebrew:

如果您想安装 GCC 作为 clang 的替代方案,您可以使用多种方法来安装,包括使用 Homebrew 的一种:

https://github.com/mxcl/homebrew/wiki/Custom-GCC-and-cross-compilers

https://github.com/mxcl/homebrew/wiki/Custom-GCC-and-cross-compilers