Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Compiling C code on a Mac os x lion

I am a beginner, trying to code C on a Mac. I am using Learn C the Hard way By Zed but when I tried running the C code on my Mac it would not run. I have installed Xcode from the mac Appstore but when I try to run my code using the command "make" or "gcc" the terminal responds command not found. Am I doing something wrong?

I have tried searching for the solution but all of the ones I have found say just to install Xcode and do not give further instructions.

I am just hoping to find out how to test/run my code. Thanks for the help in advance!

like image 679
biiiju Avatar asked Apr 25 '26 18:04

biiiju


1 Answers

Install the Command line tools via xcode. You just go into preferences and then downloads.

XCode 4.3 Command Line Tools

If you still have troubles after updating xcode or installing command line tools try this install after:

https://github.com/kennethreitz/osx-gcc-installer

Good Luck!

like image 132
earlonrails Avatar answered Apr 27 '26 09:04

earlonrails



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!