I have Mac OS X Mountain Lion. I need to compile a few apps and Perl modules. I already installed Xcode from app store but I’m unable to find gcc compiler or make command. How do I install gcc on Mac OS X 10.8.x?
Xcode includes command line development tools such as gcc and friends.
Xcode will download package and install copies of the core command line tools and system headers into system folders, including the LLVM compiler, linker, and build tools.
This entry is
Oct 25, 2013 In the past, Xcode was included as an optional install from the OS X install CD. Since Apple has gone digital and moved OS upgrades to the App Store, they also moved Xcode to the App Store. I'd say this is as simple as ever, if not more simple now that you don't have to dig up your install CD if you didn't install Xcode when you installed OS X. Designed for basic programming needs, the tool comes with the set of features necessary for creating software in the C/C languages. It provides a built-in compiler to build debug and a convenient editor for syntax styling and formatting a clean correct code. Our website provides a free download of Dev-C 5.11. The latest version of Dev-C.
Xcode includes command line development tools such as gcc and friends.
Advertisements
Step #1: Install Xcode on a Apple Mac OS X
First, make sure Xcode is installed. If it is not installed on OS X, visit app store and install Xcode.
Step #2: Install gcc/LLVM compiler on OS X
Dev C++ Mac Os
Once installed, open Xcode and visit:
Xcode menu > Preferences > Downloads > choose 'Command line tools' > Click 'Install' button:
Xcode will download package and install copies of the core command line tools and system headers into system folders, including the LLVM compiler, linker, and build tools.
Step #3: Verification
Open a terminal app and type the following commands:
Sample outputs:
$ gcc --version
$ whereis gcc
$ whereis make
Sample outputs:
Testing sample “Hello world” C program
Create a text file called a.c as follows using a text editor such as vi or cat command:
Dev C++ Mac Os X Download
To compile, enter:
Run it as follows:
Sample outputs:
$ make a
Run it as follows:
$ ./a
Sample outputs:
See also
And, there you have it, the gcc version 4.2.1 installed and working correctly on the latest version of Mac OS X 10.8.4. In Apple’s version of GCC, both cc and gcc are actually symbolic links to the llvm-gcc compiler. Similarly, c++ and g++ are links to llvm-g++. For more information and examples see the following man pages:
$ man gcc
$ man make
Dev C++ For Mac Os X
5Dev C++ Mac Os Download
of 13 in the Linux GNU/GCC Compilers Tutorial series. Keep reading the rest of the series:- Mac OS X: Install GCC Compiler with Xcode
ADVERTISEMENTS