3

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!

Anubian Noob
  • 13,426
  • 6
  • 53
  • 75
biiiju
  • 293
  • 1
  • 4
  • 5
  • 1
    Install the Command line tools via xcode. http://stackoverflow.com/questions/9344107/xcode-4-3-command-line-tools – earlonrails Jul 06 '12 at 21:58

1 Answers1

3

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!

Community
  • 1
  • 1
earlonrails
  • 4,966
  • 3
  • 32
  • 47
  • It is important to note that the command line tools will be installed automatically when you install xcode from the appstore, the only case for that is if you have copied Xcode from another computer. – charliehorse55 Jul 06 '12 at 22:01
  • I personally use GCC with as minimal usage of xcode on my mac - however, earlonrails is completely correct. – twitch Jul 06 '12 at 23:12
  • Thank you so much for the help! I guess i was searching for the wrong keywords :p – biiiju Jul 08 '12 at 02:08