View Full Version : gcc: command not found
BashStreetYouth
Jan 9, 2008, 02:36 PM
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? :o
yeroen
Jan 9, 2008, 03:21 PM
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? :o
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
Jan 9, 2008, 03:25 PM
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.
titaniumdecoy
Jan 9, 2008, 03:51 PM
Try using the cc comand.
BashStreetYouth
Jan 9, 2008, 05:28 PM
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.
yeroen
Jan 9, 2008, 07:27 PM
can you show us the commands you're using to compile your program?
BashStreetYouth
Jan 10, 2008, 01:01 AM
can you show us the commands you're using to compile your program?
gcc hello.c -o hello
If i reinstall should i first just drag the Developer folder to the trash? Will that get rid of everything?
vBulletin® v3.8.6, Copyright ©2000-2012, Jelsoft Enterprises Ltd.