Results 1 to 8 of 8
  1. #1
    gcc command not found

    Member Since
    Apr 01, 2008
    Posts
    9
    gcc command not found
    Hello,

    when I try to use the gcc command in terminal I get a message saying "-bash: gcc: command not found"

    I have installed Xcode 2.5 and I'm on Leopard.

    I've searched the forums for an answer, but I'm really new to this, so I don't know what to do if the PATH is wrong or something like that.

    I'd appreciate any help!

  2. #2
    gcc command not found
    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
    Log out and back in, and then in terminal type "whereis gcc" minus the quotes.
    CameraTime - Time lapse photography for novice and advanced users.

    When asking questions, post the version of your software. You'll receive better answers.

    Please post your results to the thread as it is good feedback.

  3. #3
    gcc command not found

    Member Since
    Apr 01, 2008
    Posts
    9
    It couldn't find it before, but now I copied the contents of /Xcode2.5/usr/bin into usr/bin and now it can find it.
    It still doesn't work though, when I'm trying to compile something (we have to use Eclipse at Uni) I get an error message saying:

    make all
    Building file: ../src/TestHelloWorld.cpp
    Invoking: GCC C++ Compiler
    g++ -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"src/TestHelloWorld.d" -MT"src/TestHelloWorld.d" -o"src/TestHelloWorld.o" "../src/TestHelloWorld.cpp"
    ../src/TestHelloWorld.cpp:9:20: error: iostream: No such file or directory
    ../src/TestHelloWorld.cpp: In function 'int main()':
    ../src/TestHelloWorld.cpp:13: error: 'cout' was not declared in this scope
    ../src/TestHelloWorld.cpp:13: error: 'endl' was not declared in this scope
    make: *** [src/TestHelloWorld.o] Error 1

    which makes me think that just copying the bin contents was not really a solution to my problem.
    How can I set it so Eclipse (and the terminal) can find something that lies in /Xcode2.5?

  4. #4
    gcc command not found
    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
    Copying the content over isn't the right answer.

    It look like the path is not being added in for XCode. Since you didn't report what 'whereis' gave you, we don't know at that level.
    CameraTime - Time lapse photography for novice and advanced users.

    When asking questions, post the version of your software. You'll receive better answers.

    Please post your results to the thread as it is good feedback.

  5. #5
    gcc command not found

    Member Since
    Apr 01, 2008
    Posts
    9
    well, whereis gcc now gives me /usr/bin/gcc as an answer, since I copied the content.
    Before that it was in /Xcode2.5/usr/bin but whereis gcc didn't give me any answer at all.

    Anyway, I've included all the includes and libraries paths into Eclipse now, but now there's one error remaining:

    /usr/libexec/gcc/i686-apple-darwin8/4.0.1/ld: /usr/lib/system/libmathCommon.A.dylib load command 6 unknown cmd field

    Isn't there some way to get all the directories in /Xcode2.5 included into the proper paths in Eclipse? And into the proper paths for the terminal, since I don't want to always include them manually whenever I'm trying to compile something.

    Still, thanks for taking the time to help

  6. #6
    gcc command not found
    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 don't know Eclipse so can't answer that. In terminal you'll have a login script for the shell you are running. I believe that would be the .profile file. Do a 'man bash' at the terminal prompt.
    CameraTime - Time lapse photography for novice and advanced users.

    When asking questions, post the version of your software. You'll receive better answers.

    Please post your results to the thread as it is good feedback.

  7. #7
    gcc command not found
    Dysfunction's Avatar
    Member Since
    Mar 17, 2008
    Location
    Tucson, AZ
    Posts
    6,821
    Specs:
    Way... way too many specs to list.
    in bash .profile would be the one I'd use, well and do use

    My path statement in .profile looks like such...

    Code:
    #paths
    export PATH=/Users/mike/scripts:$PATH:/opt/ibm/dscli
    mike
    This machine kills fascists
    Got # ? phear the command line!

  8. #8
    gcc command not found

    Member Since
    May 13, 2011
    Posts
    3
    Hi, guys,

    Could you tell me how did you solve the problem below?

    /usr/libexec/gcc/i686-apple-darwin8/4.0.1/ld: /usr/lib/system/libmathCommon.A.dylib load command 6 unknown cmd field

    Thanks a lot!

    Daqi

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. htpasswd: command not found
    By ecarter202 in forum OS X - Operating System
    Replies: 10
    Last Post: 07-30-2014, 05:54 PM
  2. Bash command not found
    By danipoak in forum OS X - Development and Darwin
    Replies: 10
    Last Post: 12-18-2013, 11:43 AM
  3. GCC_Select: command not found?
    By symantec11_76 in forum OS X - Development and Darwin
    Replies: 0
    Last Post: 12-05-2008, 01:42 PM
  4. Using cc in darwin: command not found.
    By olav in forum OS X - Development and Darwin
    Replies: 2
    Last Post: 03-28-2006, 03:31 AM
  5. gcc compiler, no stdio.h found
    By lzco in forum OS X - Development and Darwin
    Replies: 6
    Last Post: 10-21-2005, 04:23 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
  •