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

BashStreetYouth

macrumors member
Original poster
Dec 28, 2007
38
0
Hi, thought i'd start doing a bit of c programming and installed xcode from the leopard cd. Tried a basic hello world in the terminal and it says gcc not found. It's there in /Developer/usr/bin What do i do? :eek:
 

yeroen

macrumors 6502a
Mar 8, 2007
944
2
Cambridge, MA
Hi, thought i'd start doing a bit of c programming and installed xcode from the leopard cd. Tried a basic hello world in the terminal and it says gcc not found. It's there in /Developer/usr/bin What do i do? :eek:

Add /Developer/usr/bin to your $PATH environment variable.

That is in your $HOME/.bash_profile file add this line:

export PATH=$PATH:/Developer/usr/bin/
 

Cromulent

macrumors 604
Oct 2, 2006
6,802
1,096
The Land of Hope and Glory
The installer should set the path for you. What was the installer called that you clicked on? There is a main installer and two sub installers, you should only run the main one.
 

BashStreetYouth

macrumors member
Original poster
Dec 28, 2007
38
0
ok, i tried the export PATH thing although i did not have a .bash_profile or .bashrc file so i created one. Still gcc not found.

EDIT: scrap that. I logged out and back in and it was fine.

I installed off the Leopard dvd from /optional installs/xcode tools/xcodetools.mpkg

I tried cc also but no go. gcc and cc work if i go to /Developer/usr/bin in terminal and run ./gcc or./cc from there. When i did run from there, my simple hello world came up with: error: stdio.h: No such file or directory.

Should i reinstall? or set the PATH also.
 

Kofi90

macrumors newbie
Mar 26, 2013
1
0
Sorry to bump an old thread. I'm completely new to coding and have recently installed Xcode. I'm aware that I can run files within Xcode but when trying to compile them within terminal (or X11), I have the same error:

"-bash: gcc: command not found"

I would be happy to implement what seems to have worked for bashstreetyouth, however, I don't know how to perform the suggested task.

Is any assistance regarding this possible?

Mac OS X (Lion) 10.7.5
Xcode: 4.6.1
Terminal 2.2.3
 

moviebiz

macrumors member
Jul 3, 2007
32
0
Did you install the Command Line Tools? The install is optional and can be found in Xcode's Preferences under the Downloads tab. Make sure you're looking at components and you should see a button to install/download the Command Line Tools.
 

Khachidze

macrumors newbie
Mar 26, 2013
3
0
Did you install the Command Line Tools? The install is optional and can be found in Xcode's Preferences under the Downloads tab. Make sure you're looking at components and you should see a button to install/download the Command Line Tools.

i have some problems and is it need to install line tools? is other way?
 

ArtOfWarfare

macrumors G3
Nov 26, 2007
9,557
6,058
installation problem.

sorry,my english is bad

What exactly are you trying to install? Xcode from the App Store, Xcode from developer.apple.com, the Command Line Tools from Xcode, or something else?

What is the exact error message you are getting? (If your OS isn't in English, post the original here for incase someone knows the language + a translation, possibly from Google translate if you can't do it yourself, for incase no one else knows the language.)
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.