Re: Framework won't link (was: WHy is Xcode such a PITA?)
Re: Framework won't link (was: WHy is Xcode such a PITA?)
- Subject: Re: Framework won't link (was: WHy is Xcode such a PITA?)
- From: Chris Hanson <email@hidden>
- Date: Sat, 15 Dec 2007 22:51:20 -0800
On Dec 15, 2007, at 10:34 PM, Rick Mann wrote:
When you added ApplicationServices.framework to your new project,
did you add it to any of the targets in the project? A project is
used for organizing targets, targets are used for building
products. So it's not enough to just have a framework in your
project, you also need to add it to the target whose product you
want linked against that framework.
In my experience, adding a framework always adds it to all targets.
However, this was the first thing I checked, having had the same
difficulty with the other (currently working) project. It is, in
fact, a member of the target (as evidenced by the Target tab of the
Get Info window for the framework).
Did you add the framework from / (e.g. from /System/Library/
Frameworks), or did you add it from an SDK directory (e.g. from /
Developer/SDKs/MacOSX10.5.sdk/System/Library/Frameworks)?
It's unintuitive, but you really need to add frameworks, libraries,
etc. from / rather than from within an SDK directory. The compiler
will automatically tack the SDK directory onto the front of the path
-- that's what -isysroot is for -- and will do so even if the SDK
directory is already tacked onto the front. So be sure that you
dragged ApplicationServices.framework from /System/Library/Frameworks
into your project.
Also, one other thing I forgot to mention is that you shouldn't access
sub-frameworks directly. If you need to draw using Core Graphics,
just #include <ApplicationServices/ApplicationServices.h> to get the
umbrella header, and it will include all of the appropriate sub-
framework headers to let you draw with Core Graphics. If you *really*
want to access a sub-framework's headers directly, you'll need to add
a header search path that points to its umbrella framework's
Frameworks directory. But be aware that the real API is actually to
include and link against the umbrella header, and the sub-framework is
actually allowed move or change (within its umbrella) so long as it's
transparent to people linking against and including the umbrella.
-- Chris
_______________________________________________
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