cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Dynamic linking to libcurl on linux

From: Dan Fandrich <dan_at_coneharvesters.com>
Date: Thu, 11 Nov 2004 13:55:11 -0800

On Thu, Nov 11, 2004 at 01:06:13PM -0800, Jeff Phillips wrote:
> If I?m creating code that dynamically links at runtime to libcurl, should I
> pass ?libcurl.so? or ?libcurl.so.x? as the first argument to dlopen()? I?d
> prefer ?libcurl.so?. Do standard linux installations of libcurl create a
> symbolic link to the latest and greatest libcurl.so.x? I look forward to
> hearing from you linux gurus.

It should link to 'libcurl.so.3'. /sbin/ldconfig is responsible for
creating a link from libcurl.so.3.0.0 to that name at installation time.
You need the .3 in there to ensure that you're loading the correct
library; other numbers will be for versions that are not necessarily
backwards compatible. If your app is smart enough, it could dynamically
configure itself to work with other .x suffixes, but it's probably not
worth the hassle.

libcurl.so, when it exists, is a symbolic link to the version to which the
linker will link a program at compile time; that's not the name you want.

>>> Dan

-- 
http://www.MoveAnnouncer.com              The web change of address service
          Let webmasters know that your web site has moved
Received on 2004-11-11