Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Jan 9, 2008, 02:36 PM   #1
BashStreetYouth
macrumors member
 
Join Date: Dec 2007
gcc: command not found

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?
BashStreetYouth is offline   0 Reply With Quote
Old Jan 9, 2008, 03:21 PM   #2
yeroen
macrumors 6502a
 
yeroen's Avatar
 
Join Date: Mar 2007
Location: Cambridge, MA
Quote:
Originally Posted by BashStreetYouth View Post
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?
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/
__________________
all Jarvis, all the time
yeroen is offline   0 Reply With Quote
Old Jan 9, 2008, 03:25 PM   #3
Cromulent
macrumors 603
 
Cromulent's Avatar
 
Join Date: Oct 2006
Location: 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.
__________________
Neural Advance - Mac OS X, UNIX and Windows Development
Last.fm Profile | Extreme Metal Reviews
MP 4x 2.66Ghz Xeons / 6GB RAM / 640GB + 500GB + 750GB + 1TB HDDs / ATI Radeon 4870 / iPad 3
Cromulent is offline   0 Reply With Quote
Old Jan 9, 2008, 03:51 PM   #4
titaniumdecoy
macrumors member
 
Join Date: Oct 2005
Try using the cc comand.
titaniumdecoy is offline   0 Reply With Quote
Old Jan 9, 2008, 05:28 PM   #5
BashStreetYouth
Thread Starter
macrumors member
 
Join Date: Dec 2007
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.
BashStreetYouth is offline   0 Reply With Quote
Old Jan 9, 2008, 07:27 PM   #6
yeroen
macrumors 6502a
 
yeroen's Avatar
 
Join Date: Mar 2007
Location: Cambridge, MA
can you show us the commands you're using to compile your program?
__________________
all Jarvis, all the time
yeroen is offline   0 Reply With Quote
Old Jan 10, 2008, 01:01 AM   #7
BashStreetYouth
Thread Starter
macrumors member
 
Join Date: Dec 2007
Quote:
Originally Posted by yeroen View Post
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?

Last edited by BashStreetYouth; Jan 10, 2008 at 03:53 AM.
BashStreetYouth is offline   0 Reply With Quote
Old Mar 26, 2013, 09:44 AM   #8
Kofi90
macrumors newbie
 
Join Date: Mar 2013
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
Kofi90 is offline   0 Reply With Quote
Old Mar 26, 2013, 10:06 AM   #9
moviebiz
macrumors member
 
Join Date: Jul 2007
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.
moviebiz is offline   0 Reply With Quote
Old Mar 26, 2013, 10:54 AM   #10
Khachidze
macrumors newbie
 
Join Date: Mar 2013
Quote:
Originally Posted by moviebiz View Post
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?
__________________
“Don’t let the noise of others’ opinions drown out your own inner voice.”

my blog: snow leopard download
Khachidze is offline   0 Reply With Quote
Old Mar 26, 2013, 11:59 AM   #11
moviebiz
macrumors member
 
Join Date: Jul 2007
Quote:
Originally Posted by Khachidze View Post
i have some problems and is it need to install line tools? is other way?
I don't understand your question.
moviebiz is offline   0 Reply With Quote
Old Mar 26, 2013, 08:38 PM   #12
ArtOfWarfare
macrumors 603
 
ArtOfWarfare's Avatar
 
Join Date: Nov 2007
Send a message via Skype™ to ArtOfWarfare
Quote:
Originally Posted by Khachidze View Post
i have some problems and is it need to install line tools? is other way?
What problem are you having?
ArtOfWarfare is offline   0 Reply With Quote
Old Mar 27, 2013, 02:47 AM   #13
Khachidze
macrumors newbie
 
Join Date: Mar 2013
Quote:
Originally Posted by ArtOfWarfare View Post
What problem are you having?
installation problem.

sorry,my english is bad
__________________
“Don’t let the noise of others’ opinions drown out your own inner voice.”

my blog: snow leopard download
Khachidze is offline   0 Reply With Quote
Old Mar 27, 2013, 04:27 AM   #14
ArtOfWarfare
macrumors 603
 
ArtOfWarfare's Avatar
 
Join Date: Nov 2007
Send a message via Skype™ to ArtOfWarfare
Quote:
Originally Posted by Khachidze View Post
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.)
ArtOfWarfare is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
media: command not found frenzen OS X Mavericks (10.9) 1 Oct 16, 2013 07:57 PM
Nicl: command not found (how to replace it? trying to erase user) sun surfer Mac Programming 10 Jul 20, 2013 08:42 AM
Terminal on Install DVD - command not found madmac66 OS X 6 Feb 10, 2013 03:18 AM
Problem with using gcc , g++ in command line Giannos Mac Programming 8 Sep 25, 2012 05:36 AM
-bash: .: command not found sbaha OS X 1 Jun 2, 2012 12:34 AM

Forum Jump

All times are GMT -5. The time now is 05:20 PM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC