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

s1587

macrumors newbie
Original poster
Nov 16, 2007
14
0
Hi i am new to Mac so please help me out. I have to run a Linux shell using the terminal. My shell has been coded using C. I have gcc installed but bash refuses to recognize the command. I must run the program on the terminal only. Can someone please help me out here.
 
So you load Terminal.app and type gcc and then it says 'command not found'?

If so you'll need to install the Developers Tools (Xcode) which is on the Mac OS X DVD or an up to date version can be downloaded from http://developer.apple.com/tools/download/ but you'll need a free developer account to do so.
 
Hi i am new to Mac so please help me out. I have to run a Linux shell using the terminal. My shell has been coded using C. I have gcc installed but bash refuses to recognize the command. I must run the program on the terminal only. Can someone please help me out here.

screenshots please
 
So you wrote a program in "C"... did you compile it?

Sounds like you successfully started Terminal, if you have a .app,

./myApplication.app

should run it...

if you didn't compile yet,

gcc myApplication.c -o myApplication.app

then try and run it
 
If you don't specify an output name its called a.out by default. So you use ./a.out to run it.
 
i have installed xcode as well. once i type gcc prog.c i get a message "-bash: gcc: command not found".
 
Is there any specific path where the gcc folder must be stored for bash to recognize it?
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.