Mac OS X install gcc compiler

Contributor Icon Contributed by macster Date Icon October 3, 2004  
Tag Icon Tagged: Mac system administration

Compiling open source projects typically requires a C compiler and gcc is typically the compiler of choice. Mac OS X doesn’t install the gcc compiler by default but it is freely available in the xcode suite of development tools.


To install the gcc compiler, download the xcode package from http://connect.apple.com/. You’ll need to register for an Apple Developer Connection account. Once you’ve registered, login and click Download Software and then Developer Tools. Find the Download link next to Xcode Tools (version) – CD Image and click it!

Find the downloaded package, doubleclick it and follow the installation instructions to install gcc and a host of other development applications. gcc will be located at /usr/bin/gcc.

Websites tend to change over time, so if you notice that the steps to download xcode have changed, please post a comment and I’ll update the recipe.

Previous recipe | Next recipe |
 
  • bogus dude
    What if I'm still running Tiger, but the only download I see is for Leopard? The PDF says that the version listed is for Leopard only.
  • Keep looking down the list.. you'll need a version 2.x of the developer tools. Like this:

    Xcode 2.5 Developer Tools
    Xcode 2.5 is an update release of Xcode developer tools, providing bug fixes over Xcode 2.4.1. Xcode 2.5 can be installed on Tiger (Mac OS X 10.4) or on Leopard (Mac OS X 10.5).
  • math
    Keep searching, IT IS there. I went into the same issue, the default xcode that appear in the page is 3.x, but you need 2.5, it's the latest for Tiger.
    I searched in the site in the developer tools section, yeah I know it's annoying.
  • P
    Apple sucks 1GB download for GCC
  • Q
    word
  • thatguy
    GCC-4.0 requires 95mb when installed from your OS X DVD.
  • thanks for sharing the web addresses. this will help a lot.
  • Mahesh Gupta
    thank u very much.......
  • Mahesh Gupta
    May be better download iphone SDk 2.2 which has Xcode in it. size is 1.56GB.:-)
  • Rich Feit
    Thanks much! Minor change -- you first click on "Mac OSX", then there's XCode Tools in the resulting list.
  • Anonymous Coward
    srsly? 1+GB for freaking gcc? that is RIDIC!
  • Ali
    Hi,
    Thanks for the instructions. The path has changed slightly.
    Once you log in, go to: Downloads -> Developer Tools -> Xcode 3.1.2 Developer Tools and download the package called Xcode 3.1.2 Developer Tools DVD (Disk Image)

    Cheers!
  • The 'gcc compiler' is installed when one installs 'XcodeTools' (via the 'XcodeTools.mpkg' file) from the installation CD (if installing Panther [MacOS X 10.3.x] or earlier) / DVD - in the '/Xcode Tools/' folder.

    Or, in the CDs' / DVDs' '/Xcode Tools/Packages/' folder is / are the 'gccx.x.pkg' (where s.x is the version number) installer file(s).
  • I like the Apple sucks for 1GB download for GCC. It is really good. Try!
  • thatguy
    GCC-4.0 requires 95mb when installed from your OS X DVD.
  • Witek
    Some Apple forum members managed to figure out that the most up to date and final release of Xcode for Tiger is v 2.5. You can find the link to the Xcode package at http://discussions.apple.com/message.jspa?messa...
  • J.C.
    Sorry if i am repeating anyone but I know if you have mac 10.4.X then on the install disk you can find a copy of xcode...
  • J.C.
    Opps I didn't see lift chair...
    "The 'gcc compiler' is installed when one installs 'XcodeTools' (via the 'XcodeTools.mpkg' file) from the installation CD (if installing Panther [MacOS X 10.3.x] or earlier) / DVD - in the '/Xcode Tools/' folder.

    Or, in the CDs' / DVDs' '/Xcode Tools/Packages/' folder is / are the 'gccx.x.pkg' (where s.x is the version number) installer file(s)."
    Sorry
  • R
    Hi,
    I've been installed the powerpc-apple-darwin9-gcc-4.0.1. I'm now concerned with an error message from typing 'gcc -Version' into console:

    ''powerpc-apple-darwin9-gcc-4.0.1: couldn't run '/usr/bin/powerpc-apple-darwin9-gcc-ersion': No such file or directory"

    This seems to be obvious, because the letter 'v' from version is missing. But where have I look at to correct this mistake ?
  • kingman
    The GNU Compiler for Java (GCJ or gcj), a free software compiler for the Java programming language, forms part of the GNU Compiler Collection.... The GNU Compiler Collection is a full-featured ANSI C compiler..
    lift chair recliners
  • augu9
    This article provides an overview of the GNU Compiler Collection (GCC) from the Free Software Foundation and its use on Mac OS X... very useful blog and i love this article a lot..
    lift chairs
  • José Borges
    I have an Mac with OS a version 10.5.8. I recently installed Xcode v3.1.3 and I started to get errors and warnings in compiling programs with gcc, such as:
    " ..... incompatible implicit declaration of built-in function 'ceil' "
    Can someone help me?
  • sandeepkumardey
    thank you for writing this helpful notes.
    Can you tell me how to install CGAL in MAC
  • Kurt Bigler
    As a long-time XCode user it has been installed on my Mac for years, and I have applied updates occasionally. Nonetheless gcc is not located at /usr/bin/gcc (which has not been an issue until now since I don't normally use the command line for compiling). It is however, located at /Developer/usr/bin/gcc. So I added /Developer/usr/bin/gcc to my path, hoping that would let me use gcc and make to build libjpeg under Leopard. (Aside: Apple's own jpeg support via "Image IO" appears to ignore the specified "quality" for jpeg compression).

    However the ./configure script for libjpeg says:

    configure: error: installation or configuration problem: C compiler cannot create executables.

    But at least now that I altered my $PATH it recognizes that gcc is present.

    I have not tried to debug the configure script, but figure I am missing something basic, or else XCode installation practices have changed. My XCode is 3.1.1, and gcc from the command line says "i686-apple-darwin9-gcc-4.0.1".
  • Kurt Bigler
    FIXED: I installed XCode 3.1.4 and it resolved the problem. It also installed gcc in /usr/bin so I no longer have to alter my $PATH.
  • Areej
    hello
    do you know how to install ns-2.34 on mac os 10.5.5
    I all ready have XCODE 3.1.1
    thnx ,
  • This article provides an overview of the GNU Compiler Collection (GCC) from the Free Software Foundation and its use on Mac OS X... very useful!
  • jobseekers66
    well done.
    For more jobs visit http://www.staffingpower.com
  • AMIT RAUT
    RUN / CONSOLE OPTIONS ARE UNAVAILABLE FOR ANY FILE CREATED
    PLZ HELP ME WHAT SHOULD I DO??????
blog comments powered by Disqus