Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

jakee.stoltz

macrumors newbie
Original poster
Sep 17, 2010
17
0
I'm trying to run my .c file through terminal but keep running into the same problem. I use "gcc" and the file name but no matter what I try, it keeps giving me "-bash: gcc: command not found".

Here is a screenshot.
Screenshot2010-09-17at122617PM.png


What am I doing wrong?

Thanks
 
Have you installed the Developer Tools (or gcc on it's own via other means)? OSX does not have gcc installed by default...
 
I have a folder on my HD called Developer and it's full of stuff. I installed XCode quite a while ago so I don't remember for sure. How would I know for sure?
 
If you do /usr/bin/gcc what do you get. I get this:

Code:
Robert-Duncans-MacBook-Pro:~ robbie$ ls -l /usr/bin/gcc
lrwxr-xr-x  1 root  wheel  7 15 Sep 21:11 /usr/bin/gcc -> gcc-4.2
 
jakee-stoltzs-macbook:~ JakeeStoltz$ /usr/bin/gcc
-bash: /usr/bin/gcc: No such file or directory

That's what I get. So apparently I don't have that installed.

Do I just install gcc from the OS disc, sort of like installing XCode?
 
Alright. Will do. I've updated to Snow Leopard since I installed XCode so I'm probably a version behind in that anyways.

Thanks for the help.
 
Alright. Will do. I've updated to Snow Leopard since I installed XCode so I'm probably a version behind in that anyways.

Thanks for the help.

That's almost certainly what caused this. I don't think the developer tools survive .x upgrades (but the do survive .x.y).
 
As a matter of practice, I always wipe and install clean when doing .x releases. .x.y are different, but I've found that it is always better to have no cruft behind when doing major upgrades.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.