Mac Forums

Everything Apple


Register

Reply

Junior Member

Join Date: Apr 2008
Posts: 21
Quote  
01-15-2012, 09:15 AM
Default 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?
Reply With Quote
James P is offline
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 01:52 PM. Powered by vBulletin® Version 3.8.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.