On 5/29/07, Jeremy Pack <rostovpack gmail.com> 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
_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost-build
a>
|