OS X终端中无法使用GCC [英] Can't use GCC in OS X Terminal

查看:180
本文介绍了OS X终端中无法使用GCC的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经安装了开发者工具。我可以通过Xcode编译代码,并根据文档/ usr / bin / gcc& / usr / bin / cc应该指向/usr/bin/gcc-4.0。我的系统上没有符号链接或gcc-4.0(Snow Leopard)。我想要做的就是在终端上编译一些C代码!我很惊讶这个任务有多复杂。 GCC命令毫不奇怪地返回gcc:command not found。



任何人都可以对此有所了解吗?

解决方案

在安装Snow Leopard之后安装了最新的Xcode,还是从以前的操作系统安装过来的Xcode版本?

在我的系统上使用干净的Snow Leopard安装默认编译器(以及cc和gcc的符号链接)是gcc-4.2

我也有gcc-4.0,尽管这不是默认设置。


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 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?

解决方案

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.

这篇关于OS X终端中无法使用GCC的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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