Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Building nested frameworks



If you can require 10.4 and above, using @loader_path/../Framework for all your sub frameworks will work without problems (or you'd have to figure a combination with @executable_path that'll work). Frameworks that contain other frameworks are called umbrella frameworks, and you must create them as such. An umbrella framework must link to all of its sub frameworks, AND you must add the "-sub_umbrella MySubFramework" linker flag for each sub framework it has. If you need an example you can take a look at how we do it with ChatKit (http://chatkit.net).

- Ofri

- - - - - - - - - - - - - - - - - - -
http://www.dpompa.com
- - - - - - - - - - - - - - - - - - -


On 30/08/2006, at 00:17, Shamyl Zakariya wrote:

Hello,

I'm building a framework which includes a couple open source sub-frameworks. Specifically, I'm making a framework, SimpleGameFramework ( SGF.framework ) which is laid out as such:

SGF.framework
Versions
A
Headers
-my headers
Resources
-various bits and pieces
Frameworks
- SlotSig.framework
- GLEW.framework

My intent for SGF.framework is that it be completely self contained -- that I should be able to embed it in the Contents/Frameworks subfolder of the app I'm building and that app would be ready-to-go, which is to say, no external dependencies. I know about setting @executable_path/../Frameworks and have used that before for single frameworks, but not for frameworks which include other frameworks.

My issue is linking to the sub frameworks. Since they get copied into SGF.framework/Version/A/Frameworks I set their Install Dir to @executable_path/../Frameworks/SGF.framework/Versions/A/Frameworks -- I also tried the vanilla @executable_path/../Frameworks. Neither works -- I get the following linker error:

/usr/bin/ld: warning can't open dynamic library: @executable_path/../Frameworks/SGF.framework/Versions/A/Frameworks/SlotSig.framework/Versions/A/SlotSig referenced from: ../../sgf/build/Debug/SGF.framework/SGF (checking for undefined symbols may be affected) (No such file or directory, errno = 2)
/usr/bin/ld: warning can't open dynamic library: @executable_path/../Frameworks/SGF.framework/Versions/A/Frameworks/GLEW.framework/Versions/A/GLEW referenced from: ../../sgf/build/Debug/SGF.framework/SGF (checking for undefined symbols may be affected) (No such file or directory, errno = 2)
/usr/bin/ld: Undefined symbols:
SlotSig::SignalBase::~SignalBase()
SlotSig::SlotsSetBase::connect_from(SlotSig::SignalBase*)
... and so on.

What's very interesting is that if I use ZeroLink, I get a warning -- but the app runs -- meaning the linker *is* finding the nested frameworks. But without zero link I get the above.

Does anybody have any suggestions? I mean, other than simply giving up and rolling GLEW and SlotSig into SGF -- I'd prefer to avoid that since both projects are updated periodically and I'd like to keep their builds separate.


    "When you must fail, fail noisily and as soon as possible"
        - Rule 12: The Rule of Repair


_______________________________________________
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

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/xcode-users/email@hidden

This email sent to email@hidden

References: 
 >Building nested frameworks (From: Shamyl Zakariya <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.