Apple Event: May 7th at 7 am PT

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

How do I set up my system so that I can program in C

How do I set up my system so that I can program in C,C ? Without using Xcode. Just want to write simple "hello, world" stuff. So far, my Mac seem oblivious to my efforts even though it seems that all the files are there.


At first, it could not find gcc. Then I added /Developer/usr/bin to the path and it seemed to find gcc.


Then it didn't find stdio.h. I added /Developer/SDKs/MacOSX10.6.sdk/usr/include/ to the path but it still doesn't find stdio.h


There must be a standard C setup that my Mac is not conformaing to. How can I get set up like a regular Unix system and do C programming like I used to?


Thanks,

JfromG

iMac, Mac OS X (10.7.1)

Posted on Dec 28, 2012 8:55 PM

Reply
4 replies

Dec 28, 2012 11:05 PM in response to softwater

None of the responses/experiences seems to apply to me. Let me ask the question this way, because it's partly for my education and also I'd like to program in C. Let's say I have a Unix box and I want to program in C. What files need to be where in what directories? And why wouldn't that work on a Mac? My impression is that the Mac OS X 10.8 contains all I need, but it doesn't work. At least I don't think it does. I may be out in left field here. But surely, being a Unix box, I can get this machine to compile C code in something like the usual fashion. I don't need editors or development environments beyond the basic stuff - unless your telling me maybe I do! Anyway, just wondering what files need to go where in order to compile C programs. Thanks for you forbearance. I appreciate it.

JohnfromG

Dec 29, 2012 1:16 AM in response to johnfromgilroy

All you need is a gcc compiler and a text editing program (vi or emacs will do if you're used to unix command line). Unfortunately, gcc is not included by default anymore. One way to get it is from Xcode, but if you don't have Xcode, you'll need to find a repository somewhere on the net where you can download a free compiler.



Once you've got the compiler, all you need is somewhere to store your compiled programs and to put that place in your $PATH.

How do I set up my system so that I can program in C

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.