Re: adding object to a Xcode project
Re: adding object to a Xcode project
- Subject: Re: adding object to a Xcode project
- From: Fritz Anderson <email@hidden>
- Date: Wed, 10 Sep 2008 09:53:55 -0500
On 10 Sep 2008, at 4:18 AM, Nava Carmon wrote:
I would like to add an already compiled object to a Xcode project.
How do I do that? I tried to add a .o file to a project, but I still
got linker errors, so probably I miss something in project settings.
A preliminary question: Does the .o file appear in the "Link Binary
with Libraries" phase of the target you're building? Adding a file to
a project does not necessarily add it to the build process of targets
in the project. If the .o file isn't there, use the Groups & Files
list to drag it into the "Link" phase. (There are a couple of other
ways.)
If that doesn't work, follow up to this list by dragging the link-
phase line from the Build Results list into your email message. (The
line with the red stop badge that begins "Linking," not the specific
error lines you'll see if you expand that line.) That'll give us the
exact command used for linking, which might tell us something.
Another question is whether if I use the same object in a couple of
projects, the object is duplicated in the built bundle?
Yes, anything you include in a target gets copied into the target
bundle. The products of targets are assumed to be independent of each
other, so everything they need gets packaged into them.
(Adding another decimal place: If the shared object is a framework,
you have the choice of adding it to a product's package, or installing
it separately in the OS's search path, such as at /Library/Frameworks.)
(Third decimal place: Sometimes (as in embedded frameworks or
additional executables) you have to copy the resource into the
product's bundle explicitly. For most purposes, you don't.)
All this happens to be covered in a book I've written.
— F
--
Fritz Anderson -- Xcode 3 Unleashed: Now Available -- http://x3u.manoverboard.org/
_______________________________________________
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