Results 1 to 11 of 11

Thread: Installing GCC

  1. #1
    Installing GCC

    Member Since
    Aug 04, 2007
    Posts
    9
    Installing GCC
    I'm trying to get the GCC compiler installed on my Mac. I installed the gcc4.0 package on the Mac OS X Install Disc, which is in the Xcode Tools directory. However, even after installing, Terminal says it doesn't understand the gcc command…

    What did I do wrong?

  2. #2
    Installing GCC
    cradom's Avatar
    Member Since
    Feb 14, 2004
    Location
    Nederland, Texas
    Posts
    4,082
    Specs:
    13in macbook - 10.10.4
    You need to install all of Xcode, not just the gcc package. There are libraries and headers that gcc needs.
    If you're trying to save space, you can choose not to install the docs.
    Craig Domingue
    (\__/)
    (='.'=) This is Bunny. Copy and paste Bunny into your
    (")_(") signature to help him gain world domination

  3. #3
    Installing GCC

    Member Since
    Aug 04, 2007
    Posts
    9
    Thanks!

  4. #4
    danielb
    Guest
    You should not need to install the complete xcode package. It may be a PATH problem and the shell cannot find gcc anywhere it is looking. Make sure you PATH includes the bin directory containing gcc. From the terminal, type "which gcc". If it says it is not found, it is the PATH.

  5. #5
    Installing GCC
    DoubleCap's Avatar
    Member Since
    Feb 12, 2007
    Location
    Northeast US
    Posts
    552
    Specs:
    MacBook 2GHz/2GB/CD
    You do not need all of Xcode.

  6. #6
    Installing GCC

    Member Since
    Sep 18, 2007
    Posts
    6
    I actually still some problem installing GCC

    I installed the gcc 4.0 and 3.3 for good measure, yet i still fail to run it

    I do know probably its the path problem

    jonathanong:~ Jonathan$ which gcc
    no gcc in /opt/local/bin /opt/local/sbin /bin /sbin /usr/bin /usr/sbin

    And i've got problem installing darwin port because it says gcc not installed. Lets say my .c file or a header .h file is in the desktop, how do i actually compile it or find the path to link it to?

    Usually its just gcc <filename> or if i'm trying to compile a openGL file

    cc main-good.c -o simple -framework GLUT -framework OpenGL -lobjc

    but it still says -bash: cc: command not found

    An advice will tremendously help me

  7. #7
    danielb
    Guest
    Try which gcc-4.0 and see if it finds that. On my machine, all the gcc's are in /usr/bin. From your post, you have that in the path so if they are installed there it should be good.

    Here is how I did it. I wanted to use gcc filename to compile, so I made a link called gcc to gcc-4.0. If I want to use 3.0 I just change the link. Also, cc is just a link to gcc-4.0.

    lrwxr-xr-x 1 root wheel 7 Jul 11 21:58 gcc -> gcc-4.0
    -r-xr-xr-x 1 root wheel 260616 Sep 11 2006 gcc-3.3
    -rwxr-xr-x 1 root wheel 80168 Sep 27 2006 gcc-4.0

  8. #8
    Installing GCC

    Member Since
    Sep 18, 2007
    Posts
    6
    /usr/bin/gcc-4.0

    Yup, which gcc-4.0 found that

    How do i make a link to gcc or cc? If that one you were showing was it, than it doesn't work

  9. #9
    Installing GCC

    Member Since
    Sep 18, 2007
    Posts
    6
    I tried compiling, and they have problem detecting the libraries stdio.h and stdlib.h

    those common ones, not even openGLs

    Do i really have to install the whole XCode tool?

  10. #10
    Installing GCC
    xstep's Avatar
    Member Since
    Jun 25, 2005
    Location
    On the road
    Posts
    3,231
    Specs:
    2011 MBP, i7, 16GB RAM, MBP 2.16Ghz Core Duo, 2GB ram, Dual 867Mhz MDD, 1.75GB ram, ATI 9800 Pro vid
    I really don't understand why you wouldn't install the XCode tools. If nothing else, it saves you the hassle you are going through now. You could always remove the parts you do not want or need.

  11. #11
    danielb
    Guest
    gcc should look for header files in /usr/include and libraries in /usr/lib

    I would look in these locations and verify the files exist. If they do exist, it may be a gcc configuration issue. I would have expected the files to be included with the installation of gcc.

    To find out about a link "man ln" or search the web.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Installing GCC compiler to usr/local/bin
    By KBG in forum OS X - Development and Darwin
    Replies: 3
    Last Post: 05-13-2011, 08:20 PM
  2. Installing gcc on Mac OSX without re-installing XCode
    By jigglypuff in forum OS X - Development and Darwin
    Replies: 0
    Last Post: 02-26-2010, 12:16 AM
  3. Problem with installing GCC compiler
    By aloknabi in forum OS X - Development and Darwin
    Replies: 0
    Last Post: 01-11-2010, 02:31 AM
  4. Installing GCC 4.3
    By PMatos in forum OS X - Development and Darwin
    Replies: 1
    Last Post: 04-06-2008, 01:52 AM
  5. How to upgrade gcc 3 to gcc 4 intel mac
    By jonnyd in forum OS X - Development and Darwin
    Replies: 2
    Last Post: 12-29-2007, 04:34 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •