Re: carrying dynamic library in app?
Re: carrying dynamic library in app?
- Subject: Re: carrying dynamic library in app?
- From: Dave Carrigan <email@hidden>
- Date: Fri, 4 Dec 2009 13:40:39 -0800
On Dec 4, 2009, at 1:31 PM, Todd Heberlein wrote:
> I have the Graphviz libraries installed in /usr/local/lib, which seems to only include dynamic versions of the library, for example:
>
> libgvc.5.dylib
> libgvc.dylib -> libgvc.5.dylib
> libgvc.la
>
> I was hoping libgvc.la was a static version, but it seems too small and doesn't seem to work at compile time. If I build an application using these dynamic libraries, my application isn't portable because the users probably don't have the graphviz libraries installed.
>
> Is there a way to embed a dynamic library into my application so I can use it even if the user doesn't have it on their system?
If your app is a bundle and you have the distribution rights, you can just bundle the dynamic libraries using a copy files phase. I usually put them inside Frameworks. You will probably need to also fix up the loader names using a Run Script phase, something like:
install_name_tool -change /usr/local/lib/libgvc.dylib @loader_path/../Frameworks/libgvc.dylib "$BUILT_PRODUCTS_DIR/$EXECUTABLE_PATH"
The exact names you would use can be determined by using otool -L on your binary.
--
Dave Carrigan
email@hidden
Seattle, WA, USA
_______________________________________________
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