• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Framework won't link (was: WHy is Xcode such a PITA?)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Framework won't link (was: WHy is Xcode such a PITA?)
      • From: Rick Mann <email@hidden>
References: 
 >WHy is Xcode such a PITA? (From: Rick Mann <email@hidden>)
 >Re: WHy is Xcode such a PITA? (From: Chris Hanson <email@hidden>)
 >Re: Framework won't link (was: WHy is Xcode such a PITA?) (From: Rick Mann <email@hidden>)

  • Prev by Date: Re: Framework won't link (was: WHy is Xcode such a PITA?)
  • Next by Date: Re: Framework won't link (was: WHy is Xcode such a PITA?)
  • Previous by thread: Re: Framework won't link (was: WHy is Xcode such a PITA?)
  • Next by thread: Re: Framework won't link (was: WHy is Xcode such a PITA?)
  • Index(es):
    • Date
    • Thread