compiling a c program

R

rtc75225

Guest
I know this is simple but,

I am trying to compile a c program I wrote for class called calculation.c, so i type in:

$ cc calculation.c

Instead of getting a.out like I do on the LINUX computers I get an error,

- bash: cc: command not found

what am I doing wrong?
 

rman


Retired Staff
Joined
Dec 24, 2002
Messages
12,637
Reaction score
168
Points
63
Location
Los Angeles, California
Your Mac's Specs
14in MacBook Pro M1 Max 32GB 2TB
You do not have the c compiler loaded on your system.
 
OP
R

rtc75225

Guest
figures,
do you know where i could get one. I'm searching googling but not having much luck.

pardon my ignorance
 
OP
R

ramprasad

Guest
rtc75225 said:
I know this is simple but,

I am trying to compile a c program I wrote for class called calculation.c, so i type in:

$ cc calculation.c

Instead of getting a.out like I do on the LINUX computers I get an error,

- bash: cc: command not found

what am I doing wrong?


Hi,

first of all you must what version of gcc compiler you are using. If suppose a cc package is not installed in your sys,, go to spotlight and search for gcc package..A package will come..Install it..Then use the command..If the package version is gcc-4.0, then use the command gcc-4.0 instead of cc
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top