eclipse 如何在 Mac OS X Lion 中安装 gcc
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/9998384/
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
How to install gcc in Mac OS X Lion
提问by Shahjalal
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?
我是 mac os 的新手。我有一台 Mac book pro。我正在我的 Mac 中寻找 gcc。我已经安装了 XCode。因此,C++ 库已经与 XCode 一起安装。但是,我不能从 XCode 外部使用它。我想在 Eclipse 中使用 C++ 库。如果我已经有了 XCode,我不知道如何使用 eclipse 配置它或如何安装 gcc?我应该使用任何其他库吗?
Hints:
提示:
When I write following command in my terminal it shows an error.
当我在终端中编写以下命令时,它显示错误。
$ gcc -v
-bash: gcc: command not found
$
Thanks, in advance.
提前致谢。
回答by vcsjones
You need to install the Command Line Tools through Xcode.
您需要通过 Xcode 安装命令行工具。
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+.
在 Xcode 中,打开首选项,然后在下载中单击命令行工具旁边的“安装”。这假设您使用的是 Xcode 4.3+。