cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: How to tackle libcurl shared library versions?

From: Chris Conroy <Chris.Conroy_at_hillcrestlabs.com>
Date: Thu, 07 Jan 2010 14:39:36 -0500

On Thu, 2010-01-07 at 12:44 -0500, Nick Jensen wrote:
> A .dylib is the Mac equivalent of a .so file.
>
> Someone who knows Linux better than I would be able to tell you how to
> link against and bundle a shared object with your application.

You can set the -rpath and -rpath-link options when you build your
application to tell the runtime linker where to look for .so files
first. If you can control where your application is placed, then you
simply need to set the -rpath to wherever you drop the special .so (e.g.
-Wl,rpath,/opt/blah/foolibs/ -Wl,rpath-link,/opt/blah/foolibs )

If you can't control the absolute path, then you can use $ORIGIN within
the -rpath to denote a relative path. (just take care escaping it in any
Makefiles...)

You can use ldd on the built application to inspect where it will look
for all the shared libraries.

Hope that helps.

--Chris
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2010-01-07