View Single Post
jdgti

 
jdgti's Avatar
 
Member Since: Mar 14, 2005
Location: Atlanta, GA
Posts: 443
jdgti will become famous soon enough
Mac Specs: 17" Macbook Pro Unibody 2.66 Ghz and Powerbook G4 1.67 GHz 2.0GB RAM

jdgti is offline
Actually, no one has explained this on these forums for a while so I am going to help by posting a quick tutorial just for reference.

To compile a plain C file:

1. Open Xcode
2. Go to "File" and choose "New Project"
3. A window will pop up (Project Assistant Window), Scroll down a little and then expand the "Command Line Utility" set.
4. Select the "Standard Tool" (This is the Xcode's Standard C representation)
5. Name your project, Click Next
6. Go to the left side of the window under "Groups & Files" and expand the Source set.
7. There you will find something familiar, a "main.c" file. Click the "Editor" button at the very top of the window next to the circular "Info" button.
8. The C code you want to edit is on your right now.

... Edit code ...

To Compile:
1. Click the "Build and Go" button at the top of the window. (Any errors should show up in red)

To see your program in action:
1. Go to the left again under "Groups & Files"
2. Expand the "Products" set.
3. Double click on the name of your project. And as Mr. Jobs says "Boom!" And there's your program.

To Add gcc Tags:
1. Go to the left again under "Groups & Files"
2. Expand the "Targets" set
3. Right click on the name of your project.
4. Select "Get Info"
5. Click the "Build" tab at the top.
6. Scroll all the way down to the bottom.
7. Under "GCC 4.0 Warnings" click "Other Warning Flags"
8. Type in your class required flags probably something like "-ansi -pedantic -Wall" etc.

Feel free to PM me if you want one on one help.

Let us know how it turns out.

Good Luck.
QUOTE Thanks