Re: adding object to a Xcode project
Re: adding object to a Xcode project
- Subject: Re: adding object to a Xcode project
- From: Nava Carmon <email@hidden>
- Date: Wed, 10 Sep 2008 18:18:31 +0300
Thank you very much for reply.
I saw these objects in the "Link Binary with Libraries" phase, but the
problem seems to be a bit deeper.
My project settings define the project as of i386 architecture. It's
supposed to be compatible with Xcode 2.4.1 and based on 10.4sdk.
When I add objects from build/Default.../i386 and try to build, I see
a warning: Building .../ppc/MyProduct.framework object file.o is not
of the same architecture and according linker errors, that functions,
that are defined in file.o object can't be resolved.
When I add objects from build/Default.../ppc and try to build I get
the same warning but about building .../i386/MyProduct.framework
object file.o is not of the same architecture.
Something is still missing. Should I add both of them? How do I
distinguish between architectures?
Second, these objects should be indeed shared objects, because just
duplicating them into the bundle will cause multiple duplicate alerts
from the hosting application (I'm talking about IsDesign CS3 of Adobe
and my products are actually plugins of InDesign). Is there a way to
avoid duplicating objects by adding them to a couple of projects like
using soft links instead of actually objects?
Thank you very much!
Nava
On Sep 10, 2008, at 5:53 PM, Fritz Anderson wrote:
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