New To Mac-Forums?

Welcome to our community! Join the discussion today by registering your FREE account. If you have any problems with the registration process, please contact us!

Get your questions answered by community gurus Advice and insight from world-class Apple enthusiasts Exclusive access to members-only contests, giveaways and deals

Join today!

 
Start a Discussion
 

Mac-Forums Brief

Subscribe to Mac-Forums Brief to receive special offers from Mac-Forums partners and sponsors

Join the conversation RSS
OS X - Development and Darwin Discussion and questions about development for Mac OS X.

Xcode help please =(


Post Reply New Thread Subscribe

 
Thread Tools
polymerace

 
Member Since: Dec 10, 2007
Posts: 1
polymerace is on a distinguished road

polymerace is offline
I'm having a lot of problems with Xcode. Well, thing is, I'm taking an introductory C course and I wrote the sample code that is given in the book just to see the ouput. I write the code, right? Then I click Build. It always says that the build has failed. I know the code is supposed to work because it is from the book and the output should be such. If someone could walk me through compiling a C code in Xcode, that would be awesome and I'd really really appreciate it. Thanks again!
QUOTE Thanks
Del

 
Member Since: Dec 24, 2006
Location: N. Ireland
Posts: 901
Del has a spectacular aura about
Mac Specs: Mac Pro 2xQuad core 2.8GHZ

Del is offline
I have never used xcode - BUT if people here are to give help on your code it would be a good idea to post your code in the message so that they/we can examine it for errors.

Also if this forum has code tags (dont know havent checked) then use them around the c source code so that it gets nicely formatted in your forum message.
QUOTE Thanks
jdgti

 
jdgti's Avatar
 
Member Since: Mar 14, 2005
Location: Atlanta, GA
Posts: 444
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
Give me your required gcc tags and I can help you set it up.
QUOTE Thanks
jdgti

 
jdgti's Avatar
 
Member Since: Mar 14, 2005
Location: Atlanta, GA
Posts: 444
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
DrQuincy

 
Member Since: Nov 10, 2006
Location: Leeds, England
Posts: 306
DrQuincy will become famous soon enough
Mac Specs: 17" Core Duo Macbook Pro

DrQuincy is offline
Excellent, that's just what I was looking for - thanks!
QUOTE Thanks

Post Reply New Thread Subscribe


« Asking about Mach (and how to trace context switch by Dtrace) | excel data import on Mac OS X »
Thread Tools

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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 Off
Forum Jump

Similar Threads
Thread
Thread Starter
Forum
Replies
Last Post
Xcode 1.5 alejandrico OS X - Development and Darwin 0 06-03-2006 05:56 PM
Features I miss from Visual Studio, now using xCode... RChickenMan OS X - Development and Darwin 0 10-18-2005 11:14 AM
XCode Include path problem Jove OS X - Development and Darwin 0 03-18-2005 09:41 AM
New Xcode plug-in helps developers reuse code Murlyn OS X - Development and Darwin 0 11-10-2003 12:16 PM
Xcode developer tools updated Murlyn OS X - Development and Darwin 0 11-04-2003 05:09 PM

All times are GMT -4. The time now is 02:19 PM.

Powered by vBulletin
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
X

Welcome to Mac-Forums.com

Create your username to jump into the discussion!

New members like you have made this community the ultimate source for your Mac since 2003!


(4 digit year)

Already a member?