Weak linking framework with bundle ?
Weak linking framework with bundle ?
- Subject: Weak linking framework with bundle ?
- From: Mike Richmond <email@hidden>
- Date: Thu, 4 Nov 2004 17:04:32 +0000
Not an Xcode question as such, as I am not using Xcode for building,
but I figure that this is the best place to ask.
I am attempting to weak link my app with a third-party framework.
This works fine when I build my app as an app, but I also need to be
able to build it so that the majority of the code is in a bundle
which I then load dynamically using NSLinkModule() et al.
My bundle builds fine, and runs fine when the weak linked framework
is absent, but when the framework is present (in /Library/Frameworks)
I note that a simple test of symbolName against NULL suggests that
all the weak linked framework's symbols are absent. Any ideas why
this might be?
Further to this, NSIsSymbolNameDefined() reports that the weak linked
framework's symbols are defined and I am able to call
NSLookupAndBindSymbol() and NSAddressOfSymbol() on them without error
and with sensible results. And if I do this then I am able to call
the first function which I do it for, but only that one - when I call
any of the others symbols I get EXC_BAD_ACCESS. If I use the
addresses returned by NSAddressOfSymbol() I can call the functions
OK, but that's the sort of hoop I'm trying to avoid having to jump
through.
A CrashReporter log includes the weak linked framework in the list of
binary images.
My link command is:
/usr/bin/g++2 -Wl,-weak_framework -Wl,<framework_name>
-F<framework_location> -bundle ...
and I am running 10.3.4. Might this be a failing of gcc2?
Mike Richmond
Global Graphics Software Ltd
_______________________________________________
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