Le 18 mars 08 à 19:25, Wesley Smith a écrit : i List, I have some questions about frameworks linking against other frameworks. I'm working on a graphics framework (called Muro) that makes use of other libs like Cg, which come in framework form. What I'd like to have happen is to link my framework against Cg.framework and have it such that the end-user's app only has to link against my framework. Obviously, Cg.framework will have to be installed on their computer, but they should not need to add it to their xcode project. Assuming that Cg.framework and Muro.framework are located in /Library/Frameworks, should this be possible? I currently get some linker errors:
/usr/bin/ld: warning can't open dynamic library: @executable_path/../Frameworks/Cg.framework/Cg referenced from: /Developer/SDKs/MacOSX10.4u.sdk/Library/Frameworks/Muro.framework/Muro (checking for undefined symbols may be affected) (No such file or directory, errno = 2) /usr/bin/ld: Undefined symbols: _cgCreateContext referenced from Muro expected to be defined in @executable_path/../Frameworks/Cg.framework/Cg _cgCreateProgram referenced from Muro expected to be defined in @executable_path/../Frameworks/Cg.framework/Cg
There are more symbols missing, but I think the point is clear. For one thing, I have /Library/Frameworks set in the "Frameworks search path" option in Xcode's build settings. I haven't been able to much info specific to this subject yet. Any ideas?
thanks, wes
It's possible using umbrella framework, (that what Apple do with Cocoa that use Foundation and AppKit) but the doc also sais:
«While it is possible to create umbrella frameworks using Xcode, doing so is unnecessary for most developers and is not recommended.Apple uses umbrella frameworks to mask some of the interdependencies between libraries in the operating system. In nearly all cases, you should be able to include your code in a single, standard framework bundle. Alternatively, if your code was sufficiently modular, you could create multiple frameworks, but in that case, the dependencies between modules would be minimal or nonexistent and should not warrant the creation of an umbrella for them.»
That said, search for umbrella framework in documentation.
|