How to compile and run c on mac osx?
I'm trying to compile programs written in c using terminal on a mac. Xcode is installed. Originally when using the gcc command I would get an error saying that the command gcc cannot be found. I tried to copy over everything to do with gcc to /usr/bin however for some reason it says I do not have permission. Instead I added a new PATH to terminal to look into /Developer/usr/bin and it worked. However now I'm getting the error that the library <stdio.h> cannot be found. How can I make it so the compiler can find stdio.
Also, whenever I close terminal and reopen the path I previously created does not save and I have to re-add the path /Developer/usr/bin to get gcc to work. Is there a way to get around always having to set my path each time I open terminal?
|