简体   繁体   English

如何在OS X Lion上获得GCC?

[英]How do I get GCC on OS X Lion?

I recently bought a new Mac and did a time machine restore of my old mac & updated the xCode version to the latest version. 我最近购买了一台新Mac,并对旧Mac进行了时间机器还原,并将xCode版本更新为最新版本。 After the move I have lost the ability to use Make and GCC; 移动之后,我失去了使用Make和GCC的能力; saying these commands are unavailable. 说这些命令不可用。 I use Make and GCC to develop for homework assignments for classes that I later SCP up to a Linux box at school then run from there. 我使用Make和GCC开发课程的家庭作业,这些课程后来我SCP到学校的Linux盒子,然后从那里运行。

How do I get GCC and Make for Mac OS Lion? 如何获得Mac OS Lion的GCC和Make? I've seen some articles on how to install via source via compiling but they automatically assume you have GCC installed, which I do not. 我看过一些有关如何通过编译通过源安装的文章,但它们会自动假定您已安装GCC,而我没有。

Please help! 请帮忙!

gcc should be in /Developer/usr/bin/ . gcc应该在/Developer/usr/bin/ Check there. 检查那里。

  1. You have to download Xcode from the app store 您必须从应用商店下载Xcode
  2. You have to run the Install Xcode application 您必须运行“安装Xcode”应用程序
  3. Within Xcode go to Preferences -> Downloads and click install for the command line tools 在Xcode中,转到“首选项” ->“ 下载” ,然后单击“ 安装”以获取命令行工具

You'll find the tools at the usual place, for example /usr/bin/make. 您会在通常的位置找到这些工具,例如/ usr / bin / make。

See also post on superuser.com 另请参见superuser.com上的帖子

You can access the App Store and download XCode. 您可以访问App Store并下载XCode。 It's free. 免费。 It will give you llvm (compiler), make and related tools. 它将为您提供llvm(编译器),make和相关工具。

Unfortunately justing updating the path (which I found not in any /Developer but actually in /Applications/Xcode.app) doesn't solve other issues like missing manpages. 不幸的是,仅仅更新路径(我在任何/ Developer中都找不到,但实际上在/Applications/Xcode.app中找到了路径)并不能解决其他问题,例如缺少手册页。 Apple has released a new developer download for command line developer tools. 苹果已经发布了用于命令行开发人员工具的新开发人员下载。 Either go directly to Apple's developer page, for find a little more info and the link here . 您可以直接转到Apple的开发人员页面,以获取更多信息以及此处的链接。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM