• 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
Problem with setting dylib paths to ship them in my app bundle
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Problem with setting dylib paths to ship them in my app bundle


  • Subject: Problem with setting dylib paths to ship them in my app bundle
  • From: Parimal Das <email@hidden>
  • Date: Fri, 16 Apr 2010 20:16:09 +0530

Hello

I am using a third-party library, which has 2 dylibs in it.
Say, libABC.dylib and libXYZ.dylib

On doing a
$ otool -L libABC.dylib
libABC.dylib:
    libABC.dylib (compatibility version 1.0.0, current version 1.0.0)
    libXYZ.dylib (compatibility version 0.0.0, current version 0.0.0)
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version
111.1.5)

$ otool -L libXYZ.dylib
libXYZ.dylib:
    libXYZ.dylib (compatibility version 0.0.0, current version 0.0.0)
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version
111.1.5)

Now i want to ship these dylibs, with my app.
For that i have changed the dylib paths as

$ install_name_tool -id    @executable_path/../Frameworks/libABC.dylib
libABC.dylib
$ install_name_tool -id    @executable_path/../Frameworks/libXYZ.dylib
libXYZ.dylib

This changes the inside dylib paths as
$ otool -L libABC.dylib
libABC.dylib:
    @executable_path/../Frameworks/libABC.dylib (compatibility version
1.0.0, current version 1.0.0)
    libXYZ.dylib (compatibility version 0.0.0, current version 0.0.0)
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version
111.1.5)

$ otool -L libXYZ.dylib
libXYZ.dylib:
    @executable_path/../Frameworks/libXYZ.dylib (compatibility version
0.0.0, current version 0.0.0)
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version
111.1.5)


The problem here is:
libABC is internally calling libXYZ,
i am unable to change this path, to a path relative to my mach-o binary
(inside my app bundle)
So my app is failing to load.

Dyld Error Message:
  Library not loaded: libXYZ.dylib
  Referenced from:
/Users/pd/Desktop/MyTool.app/Contents/MacOS/../Frameworks/libABC.dylib
  Reason: image not found


Please suggest some direction.
The third party library is only creating dylibs, no static libs
And i am more comfortable with XCode then CMake.
I also tried setting XCode options to get dylibs from "@executable_path" but
it didnt work.
Or i should load my dylibs through code?

Please suggest. I am clueless here.
Advance Thanks :)


-Parimal Das


--
Warm Regards,

Parimal Das
Webyog Softworks
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Prev by Date: Re: How to empty the Trash programmatically?
  • Next by Date: Re: How to find all clipping siblings for a view?
  • Previous by thread: Re: MVC question about updating the Model
  • Next by thread: MKMapView crashes if released to early / in the wrong moment
  • Index(es):
    • Date
    • Thread