0

I am on a Mac running Mac OS X 10.6.3 and Xcode 3.2.1 64-Bit and I was wondering if it was possible to compile a C program with multiple .c files in Xcode.

Thanks in advance!

3 Answers 3

4

Sure it is.

Assuming you're starting from scratch (without an existing XCode project), do a "new project" and choose the "Mac OS Application" -> "Command Line Tool" -> "C" project template.

That will give you a skeleton project with a template "main.c". Edit/replace "main.c" as needed, and add the rest of your .c files to the "source" group and build.

Sign up to request clarification or add additional context in comments.

Comments

0

Only the last .c is significant. main.c.c.c.c will be treated as a C-language source.

Not "fooling" though, check the column of checkboxes in the project list view. It's marked with a bullseye as the header. The checkmark signifies that the source is compiled into the selected target. Unchecked boxes are the only possible problem I can think of.

Comments

0

Definitely - just add all the .c files to your project.

5 Comments

I think you meant 'just add all the .c files' ?
OMG WHAT THE... YOUR AND MY AVATARS HAVE BEEN MESSED WITH!! THEYRE FREAKING UNICORNS?!?!??!?!
WTF THE SITE HAS BEEN HACKORD!!
I blame "OMG Ponies" for this one :-) [ or check your calendar, depending on what timezone you're in :-) ]
@David, yea i just realized this, im like "oh yea!! tomorrows april 1st" :D

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.