OS X 10.9 gcc 链接到 clang [英] OS X 10.9 gcc links to clang

查看:26
本文介绍了OS X 10.9 gcc 链接到 clang的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚注意到在安装 OS X 10.9 之后,g++ 编译器链接到了 clang 编译器.有没有办法恢复到gcc/g++?

I just noticed that after installing OS X 10.9, the g++ compiler links to the clang compiler. Is there anyway to revert back to gcc/g++?

推荐答案

这种方式已经存在很长时间了.10.8 自带的GCC"其实就是 GCC 前端加上 LLVM 后端.

It has been this way for a long time already. The "GCC" that came with 10.8 was really GCC front-end with LLVM back-end.

获得 GCC 的最佳方式是通过 Homebrew.在链接页面底部的一行 homebrew install 命令之后,您只需要:

The best way to get GCC is via Homebrew. After the one-line homebrew install command on the bottom of the linked page, you just need:

$ brew install gcc49

与 macports 不同,Homebrew 不会弄乱您的系统目录,而且在管理版本和卸载方面要好得多.它也不需要被称为 sudo 的拐杖.

Unlike macports, Homebrew doesn't clutter your system dirs and it's much better at managing versions and uninstalls. It also doesn't require the crutch known as sudo.

这篇关于OS X 10.9 gcc 链接到 clang的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆