• 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: Forcing Xcode to prefer a specific dylib
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Forcing Xcode to prefer a specific dylib


  • Subject: Re: Forcing Xcode to prefer a specific dylib
  • From: Jean-Daniel Dupas <email@hidden>
  • Date: Thu, 17 Apr 2008 23:22:48 +0200


Le 17 avr. 08 à 21:51, Chris Hanson a écrit :

On Apr 17, 2008, at 4:25 AM, Brad Peterson wrote:

On 10.5, Xcode seems to prefer libcurl.4.dylib, even
though other earlier versions are available. Of
course, on 10.4, only libcurl.3.dylib is available.

That's not quite what's going on.

Each dynamic library has an "install name" embedded within it at the time it's built; this install name is typically the full path to the library on disk. When you link against a dynamic library, the install name of that library is copied into your executable.

So you're telling Xcode to link against libcurl.dylib. The install name embedded within libcurl.dylib in the Mac OS X 10.5 SDK included with Xcode 3.0 is libcurl.4.dylib -- you can see this by doing

 % otool -D /Xcode3.0/SDKs/MacOSX10.5.sdk/usr/lib/libcurl.dylib
 /Xcode3.0/SDKs/MacOSX10.5.sdk/usr/lib/libcurl.dylib:
 /usr/lib/libcurl.4.dylib

at the command line. (Substituting wherever you have Xcode 3.0 installed, of course.) However, in the 10.4 (Universal) SDK, libcurl.dylib's install name is libcurl.3.dylib:

 % otool -D /Xcode3.0/SDKs/MacOSX10.4u.sdk/usr/lib/libcurl.dylib
 /Xcode3.0/SDKs/MacOSX10.4u.sdk/usr/lib/libcurl.dylib:
 /usr/lib/libcurl.3.dylib

Right now, your only options are to build against the 10.4 (Universal) SDK, or to use install_name_tool to change the install- name for libcurl in your executable *after* it has been linked.

Please file a bug against the Mac OS X 10.5 SDK for this; you should be able to build against the 10.5 SDK and deploy against 10.4, and anything which prevents that is a bug.

-- Chris

Unfortunaty, the install name is not the only field the linker watch. There is also the compatibility version. The OP has already try to change the install name, but as library versions do not match, dylib fail to load libcurl at runtime.


otool -L /usr/lib/libcurl.dylib
/usr/lib/libcurl.4.dylib (compatibility version 5.0.0, current version 5.0.0)



_______________________________________________ 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
References: 
 >Forcing Xcode to prefer a specific dylib (From: Brad Peterson <email@hidden>)
 >Re: Forcing Xcode to prefer a specific dylib (From: Chris Hanson <email@hidden>)

  • Prev by Date: Hello
  • Next by Date: re: Unable to debug custom executable
  • Previous by thread: Re: Forcing Xcode to prefer a specific dylib
  • Next by thread: Re: Forcing Xcode to prefer a specific dylib
  • Index(es):
    • Date
    • Thread