开发者

Can't use GCC in OS X Terminal

I have installed the developer tools. I can compile code via Xcode and according to the docs /usr/bin/gcc & /usr/bin/cc should point to /usr/bin/gcc-4.0. Neither the开发者_如何学C symlinks or gcc-4.0 exist on my system (Snow Leopard). All I wish to do is compile some C on the terminal! I'm amazed by how complicated this task is. The command GCC is unsurprisingly returning "gcc: command not found".

Can anyone shed some light on this?


No! Reinstalling is the wrong answer!

Newer versions of XCode require you to install the command-line versions of the tools separately. In XCode, go to Preferences | Downloads, check the Components tab, and install them from there:

Can't use GCC in OS X Terminal


These binaries should be there after installing xcode. Check your path settings, and if you still don't have these reinstall xcode


Command line tools are no longer included with the latest XCode (even as an add on). Now you can download them here:

https://developer.apple.com/downloads/index.action


Did you install the latest Xcode after installing Snow Leopard, or is this the version of Xcode from a previous OS installation?

On my system with a clean Snow Leopard install the default compiler (and the one symlinked from cc and gcc) is gcc-4.2

I do have gcc-4.0 too, although it's not the default.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜