xcode 在mac osx上安装gcc而不安装xcode

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/5307433/
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-09 03:46:29  来源:igfitidea点击:

Install gcc on mac osx without installing xcode

xcodemacosgcc

提问by Ben

Possible Duplicate:
Is there a way to install gcc in OSX without installing Xcode?

可能的重复:
有没有办法在不安装 Xcode 的情况下在 OSX 中安装 gcc?

Is there any way to just install the gcc compiler on mac osx without the entire xcode development monstrosity? The latest xcode download is 4.5GB and all I want to do is compile something with gcc. That is a tad bit of overkill.

有没有办法在没有整个 xcode 开发怪物的情况下在 mac osx 上安装 gcc 编译器?最新的 xcode 下载是 4.5GB,我想做的就是用 gcc 编译一些东西。这有点矫枉过正。

Surely there is a better way?

当然有更好的方法吗?

[Now this is supported in OSX XCode command line tools]

[现在 OSX XCode 命令行工具支持此功能]

采纳答案by Coxy

While it is definitely possible to install gcc without Xcode, it seems that nobody packages it in such a way...
That said, it does seem like your main reason for asking is to avoid the large download? If you still have the OS install discs that came with your Mac then we can get Xcode installed without having to download it from scratch.
On the root level of the DVD should be an Optional Installsfolder that contains an Xcode installer.

虽然绝对可以在没有 Xcode 的情况下安装 gcc,但似乎没有人以这种方式打包它......
也就是说,您提出问题的主要原因似乎是避免大量下载?如果您仍然拥有 Mac 随附的操作系统安装光盘,那么我们可以安装 Xcode,而无需从头开始下载。
DVD 的根目录应该是一个Optional Installs包含 Xcode 安装程序的文件夹。

Edit: maybe there is a way after all!
This page links to binaries of gcc for System 10.6:
http://hpc.sourceforge.net/

编辑:也许毕竟有办法!
此页面链接到 System 10.6 的 gcc 二进制文件:http:
//hpc.sourceforge.net/

回答by Jason

In February 2012 Apple released the command line tools for Xcode as a separate download: https://developer.apple.com/downloads/index.action

2012 年 2 月,Apple 发布了 Xcode 的命令行工具作为单独的下载:https: //developer.apple.com/downloads/index.action

For background you can read this post from the author of the osx-gcc-installer project: http://kennethreitz.com/xcode-gcc-and-homebrew.html

对于背景,您可以阅读 osx-gcc-installer 项目作者的这篇文章:http: //kennethreitz.com/xcode-gcc-and-homebrew.html

回答by big-circle

Here is the place where I got the CLT without Xcode. Hope it works. https://www.dropbox.com/sh/pneetxuvlljc6m0/jlRLmI4MBo/xcode44cltools_10_86938106a.dmg

这是我在没有 Xcode 的情况下获得 CLT 的地方。希望它有效。 https://www.dropbox.com/sh/pneetxuvlljc6m0/jlRLmI4MBo/xcode44cltools_10_86938106a.dmg