Boost logo

Boost-Build :

From: Andreas Fredriksson (deplinenoise_at_[hidden])
Date: 2007-05-30 03:41:45


On 5/29/07, Jeremy Pack <rostovpack_at_[hidden]> wrote:
> I have two shared libraries. The first one links to the second one, i.e.:
>
> lib Vehicle : VEHICLE_SOURCE : <link>shared ;
> lib Car : CAR_SOURCE Vehicle : <link>shared ;
>
> install ../bin :
> Vehicle Car :
> <install-dependencies>on
> ;
>
> The Car library will not load on OS X or Linux, because it cannot find the
> Vehicle library - even though they are in the same directory. On Linux, this
> was fixed by setting the LD_LIBRARY_PATH (this would probably work on OS X
> as well). I can also fix it on OS X by copying Vehicle.dylib to
> ../bin/bin/darwin/debug/ (or release, depending on the variant). I need to
> get them to see each other when they are in the same directory - it is a bit
> of a waste to have two copies of Vehicle.

One thing I did was to install all binaries and shared libraries to
the same staging directory and added

<linkflags>"-Wl,-rpath,'$ORIGIN'"

globally to my Jamroot in the top-level project. That sets up the ELF
headers for all targets to that they will consider the executable's
directory when looking for shared libraries. This can be very
convenient for development, but I don't know if boost.build supports
this natively. Note that this works if you move the binary and
libraries away too as it's determined at runtime by ld.so.

Hope this helps,
Andreas


Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk