• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: carrying dynamic library in app?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: carrying dynamic library in app?
      • From: Todd Heberlein <email@hidden>
References: 
 >carrying dynamic library in app? (From: Todd Heberlein <email@hidden>)

  • Prev by Date: carrying dynamic library in app?
  • Next by Date: Re: difference between -m32 and -arch i386
  • Previous by thread: carrying dynamic library in app?
  • Next by thread: Re: carrying dynamic library in app?
  • Index(es):
    • Date
    • Thread