如何在Mac OS X Lion中安装gcc [英] How to install gcc in Mac OS X Lion

查看:112
本文介绍了如何在Mac OS X Lion中安装gcc的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Mac OS的新手.我有一个Mac书本专业版.我正在Mac中寻找gcc.我已经安装了XCode.因此,C ++库已经随XCode一起安装.但是,我不能从XCode外部使用它.我想在Eclipse中使用c ++库.如果我已经有了XCode,我不知道如何使用eclipse进行配置或如何安装gcc?我应该使用其他图书馆吗?

I am new in mac os. I have one Mac book pro. I am looking for gcc in my Mac. I already install XCode. So, C++ library already installed with XCode. But, I can not use it from outside XCode. I want to use c++ library with Eclipse. I do not know how to configure it with eclipse or how to install gcc, if I already have XCode? Should I use any other library?

提示:

当我在终端中编写以下命令时,它会显示错误.

When I write following command in my terminal it shows an error.

$ gcc -v
-bash: gcc: command not found
$

谢谢.

推荐答案

您需要通过Xcode安装命令行工具.

You need to install the Command Line Tools through Xcode.

从Xcode中打开首选项",然后在下载"上单击命令行工具"旁边的安装".假设您使用的是Xcode 4.3 +.

From Xcode, open up Preferences, then on Downloads click "Install" next to the Command Line Tools. This assumes that you are using Xcode 4.3+.

这篇关于如何在Mac OS X Lion中安装gcc的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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