Re: Dynamically linking a framework...
Re: Dynamically linking a framework...
- Subject: Re: Dynamically linking a framework...
- From: Loren Ryter <email@hidden>
- Date: Fri, 13 Jun 2008 08:30:49 -0400
- Thread-topic: Dynamically linking a framework...
Thanks to some great tips and links from Jerry, I did manage to figure out
nearly the exact same thing late last night. Thanks also to you 2 who
responded, which just confirms that it's not a fluke that it worked.
For newbies at this like me, what I actually needed to do was this:
1. add the CalendarStore.framework to the project & build at least once (**)
2. add this line to the Other Linker Flags on the Builds section of Targets:
--weak_framework CalendarStore
3. build again for good measure
4. delete CalendarStore.framework (I had to both where Xcode stuck it in
"Scripts" and in "Link Binary with Libraries" under Target.
5. build again!
6. of course you have to make sure you never create or call the custom obj-c
class that in turn imports CalendarStore.framework if Leopard is not running
Presumably since the obj-c class is already created as needed on Leopard
only, there was no need to create any separate bundles, etc., or do any
symbolic linking, as some of the related documents suggest. (And that came
as a huge relief ;-)
(**) if I didn't do step #1 first it would not build after I put in the
--weak _framework setting
On 06/13/08 3:09 AM, "Jean-Daniel Dupas" <email@hidden> wrote:
>
> Le 13 juin 08 à 05:49, Peter O'Gorman a écrit :
>
>> Loren Ryter wrote:
>>> Hello,
>>>
>>> I'm newly subscribed to this group and want to ask a question
>>> that's sort of
>>> been raised before but that I haven't been able to solve.
>>>
>>> I want to build a project in Xcode 3.0 on Leopard which would
>>> include a
>>> framework (Calendar Store) that is only available on Leopard.
>>> However, the
>>> application must be able to launch on Tiger. Obviously calls to the
>>> Calendar Store API would not be done if the system was Tiger.
>>
>> Seems like you should be using -weak_framework to link the framework
>> then. They dynamic linker will not load it if it is not there. See the
>> man page for ld for more information.
>>
>> Peter
>
> The current Xcode version does not have a way to specify that a
> framework has to be weak linked, so the way to do it is to not include
> the Calendar Framework in your taget Linker step, and add the "-
> weak_framework Calendar" in linker flags.
>
>
_______________________________________________
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