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: Rick Mann <email@hidden>
- Date: Sat, 15 Dec 2007 23:07:09 -0800
On Dec 15, 2007, at 10:51 PM, Chris Hanson wrote:
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)?
I did. I thought that's what it was for. In the old days, we'd link
against Universal Headers and stub libraries. Seemed to me something
similar was being accomplished with the SDK stuff.
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.
You're right, it's unintuitive.
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.
This really rubs me the wrong way. I *hate* including a bunch of stuff
I don't really want to use. For one, it makes it a bit harder to track
down the definition of a symbol (when you don't have the luxury of
Xcode's doc features, or it's behaving erratically). Second, it takes
longer/more memory to build. Everyone says this doesn't appreciably
slow things down, but it still consumes resources. And it rubs me the
wrong way.
That said, changing dozens of include files to only include the
umbrella header seems to work. I'm annoyed that it managed to work in
my previous project (probably because I had included the subframeworks
directly then).
Thanks.
--
Rick
_______________________________________________
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