Re: Linking object codes
Re: Linking object codes
- Subject: Re: Linking object codes
- From: Shawn Erickson <email@hidden>
- Date: Wed, 7 Dec 2005 12:22:42 -0800
Assuming you are using Xcode 2.2 read over the rather complete
documentation linked below (and available locally on your system as
well).
<http://developer.apple.com/documentation/DeveloperTools/Conceptual/XcodeUserGuide/Contents/Resources/en.lproj/index.html>
Also likely go over the Quick Tour Guide...
<http://developer.apple.com/documentation/DeveloperTools/Conceptual/XcodeQuickTour/index.html>
Anyway to try to answer your questions... when you add a file to Xcode
you select which targets that the file should be a member of. For
source files (.c, .cpp, etc.) that implies the source file should be
compiled and linked into the binary generated by the target (for libs
it implies linking in the library, for images it implies copying that
resource into the application bundle, etc.). So just add the files the
target needs and click build... Xcode will do the right thing behind
the scenes. To see what Xcode is doing behind the scenes open the
Build Results window ("Build" and select "Build Results") then locate
and click the little square button in the lower left corner that looks
like lines of text (tool tip says "Select this to show or hide build
transcript.")
Object files go into an intermediate directory that can be configured
globally, per-project or per-target so it is hard to answer you
exactly. By default intermediates go into a folder in the Build
directory next to your xcode project.
-Shawn
On 12/7/05, Rich Frazin <email@hidden> wrote:
> I'm new to Xcode and I've found that Apple's documentation does
> not have enough examples for me to get started with building C
> applications. Here is an example problem that I would like to solve
> with Xcode instead of using a Makefile:
>
> I have two source files, main.c and brent.c. How do I use Xcode to perform
> the equivalent of these two unix commands?
>
> rich>gcc -c -o brent.o brent.c
> rich>gcc -lm -o myapp brent.o main.c
>
>
> I have already started the Project in Xcode and I have the two .c source
> files in the project. I don't know how to tell Xcode that myapp depends on
> brent.o, how to build brent.o, or how to link them.
>
> Also, where does Xcode put the object files?
>
> Thanks,
> Rich
>
>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden