有没有办法在不安装 Xcode 的情况下在 OSX 中安装 gcc? [英] Is there a way to install gcc in OSX without installing Xcode?

查看:43
本文介绍了有没有办法在不安装 Xcode 的情况下在 OSX 中安装 gcc?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在谷歌上搜索了它,似乎没有办法在 OS X 上安装 gcc 而不安装 Xcode(它至少需要 1.5GB 的空间).我所需要的只是 gcc 而不是 Xcode 附带的任何其他垃圾.在这一点上,我将使用任何其他类型的 C 编译器.

I've googled the hell out of it, and it seems like there is no way to install gcc on OS X without installing Xcode (which takes at leats 1.5GB of space). All I need is gcc and none of the other junk that comes with Xcode. And at this point, I'll take any other kind of C compiler.

我知道我可以简单地安装 Xcode,但这不是重点,因为我既没有原始安装光盘,也没有快速的互联网连接.

I know I could simply install Xcode, but that is beside the point since I neither have my original installation disc nor a quick internet connection.

所以...有人有什么建议吗?

So... does anyone have any suggestions?

对不起,如果我不清楚,但我也需要标题.我目前正在通过 fink 安装 gcc4,它也在下载共享库.我会更新进度.

Sorry if I was unclear, but I need the headers as well. I'm currently installing gcc4 via fink and it's downloading the shared libraries as well. I'll update on the progress.

编辑 2:好的,所以我使用 fink 成功安装了 gcc.但是,它几乎没用:错误:C 编译器无法创建可执行文件".谷歌搜索后,我发现没有安装 Apple 的开发者工具是导致错误的原因.可能是因为我需要所有只能通过 Xcode 获得的库、头文件等.

EDIT 2: Ok, so I successfully installed gcc using fink. BUT, it's pretty much useless: "error: C compiler cannot create executables". After googling around, I found that not having Apple's Developer Tools installed is the cause of the error. Probably because I need all the libraries, headers, etc that are only available through Xcode.

推荐答案

尝试 osx-gcc-安装程序在github上.

Try the osx-gcc-installer on github.

这篇关于有没有办法在不安装 Xcode 的情况下在 OSX 中安装 gcc?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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