37

I want to install Eclim on my MacBook Air (2011 version). But there are some problems I faced during the installation. It told me that I did not install make and GCC.

I tried to find the solution for it, but all solutions are talking about using Xcode. In fact, I installed Xcode.

But I still cannot install Eclim because there are no make and GCC installed.

How can I install them so that I can install Eclim?

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
code4j
  • 4,208
  • 5
  • 34
  • 51
  • Related (a canonical question): *[How can I compile and run C/C++ code in a Unix console or Mac terminal?](https://stackoverflow.com/questions/221185/)* – Peter Mortensen May 08 '22 at 13:41

4 Answers4

82

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.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Joachim Isaksson
  • 176,943
  • 25
  • 281
  • 294
20

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

brew install make

It might require root permissions.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Keshav
  • 392
  • 3
  • 8
  • I guess the latest version of gcc can be installed with brew too, with the command `brew install gcc`. But then you may need to add a path to enable these installations to be picked up at runtime by your computer. Like `export PATH="/usr/local/bin:$PATH"` for gcc and `export PATH="/usr/local/opt/make/libexec/gnubin:$PATH"` for make. – Kris Stern Aug 04 '19 at 18:09
3

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

Rafael Kassner
  • 1,123
  • 6
  • 21
  • Apple has their own officially supported version now too you can download from [developer.apple.com/downloads](https://developer.apple.com/downloads) with a free developer account. Kenneth details it [here](https://medium.com/kr-projects/6e54e8c50dc8) – twamley Jun 26 '13 at 06:27
1

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.

geekosaur
  • 59,309
  • 11
  • 123
  • 114