How to install make and gcc on a mac?

别说谁变了你拦得住时间么 提交于 2019-12-03 02:18:15

Update for newer versions:

The command line versions can now be installed straight from the command line itself;

  • Open "Terminal" (it is located in Applications/Utilities)
  • In the terminal window, run the command xcode-select --install
  • In the windows that pops up, click Install, and agree to the Terms of Service.

Once the installation is complete, the command line utilities should be set up property.


Older versions:

Installing recent XCode versions confusingly enough does not automatically install the command line tools. To install the command line tools when they're not automatically installed;

  • Start XCode.
  • Go to XCode/Preferences.
  • Click the "Downloads" tab.
  • Click "Components".
  • Click "Install" on the command line tools line.

That will install the command line tools and make them accessible from a regular command line.

You can also use this standalone GCC installed (got from Xcode).

With modern Xcode (4.3) you will need to run the GUI and have it install the command line tools. I'll quote from the MacPorts ProblemHotList because I have it bookmarked:

Xcode 4.3 does not include a fully working set of command line tools by default. Nothing will build without it, despite the fact that xcode-select and which make may return correct values.

You must open Xcode, go to Preferences, and download this component from the Downloads section. You will require an Apple ID to download the component.

With Homebrew installed on my mac , the installation was as simple as running the command

brew install make

It might require root permission.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!