Re: To add or not to add libraries
Re: To add or not to add libraries
- Subject: Re: To add or not to add libraries
- From: Scott Anguish <email@hidden>
- Date: Sun, 3 Aug 2003 01:48:38 -0400
On Sunday, August 3, 2003, at 1:24 AM, Chad Armstrong wrote:
Is there a way to dynamically check if a library or framework exists
on a person's computer, and if so, add the library or framework. If
it doesn't exist, just skip past and don't worry about it. I have an
app I wrote, and it seems like it couldn't find a framework on another
computer, and just crashed before opening fully.
Well, it depends on the library or framework. Weak-linking is one
solution, and another is dynamically loading the framework and any
dependent code only after determining that the framework is present.
There is a relevant article in the WebKit documentation.
<
http://developer.apple.com/documentation/Cocoa/Conceptual/
DisplayWebContent/Tasks/WebKitAvail.html>
Although it is specific to detecting if WebKit is available, the
techniques are easily adapted to other frameworks.
If it's a C library, this should be of use "Ensuring backwards
compatibility - Weak Linking and Availability Macros in Mac OS X 10.2"
<
http://developer.apple.com/technotes/tn2002/tn2064.html>
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.