... | ... | @@ -29,7 +29,7 @@ the same library installed, e.g. `/opt/kde3/lib/libkdecore.so` and |
|
|
|
|
|
For the first case it would work if the user would set `LD_LIBRARY_PATH`
|
|
|
accordingly:
|
|
|
``` bash
|
|
|
```shell
|
|
|
export LD_LIBRARY_PATH=$HOME/lib:$LD_LIBRARY_PATH
|
|
|
```
|
|
|
|
... | ... | @@ -49,8 +49,8 @@ install name of `/usr/lib/libSystem.B.dylib` as given by `otool -D`. |
|
|
When linked into "foo", "foo" has a dependency on
|
|
|
`/usr/lib/libSystem.B.dylib`. This dependency can be seen with `otool -L
|
|
|
foo`. For relocatable binaries, `@executable_path`, `@loader_path` and
|
|
|
`@rpath` are available to use. In the "foo" example, @executable_path and
|
|
|
@loader_path are substituted for the location of "foo". @rpath is
|
|
|
`@rpath` are available to use. In the "foo" example, `@executable_path` and
|
|
|
`@loader_path` are substituted for the location of "foo". `@rpath` is
|
|
|
substituted with the RPATHs in "foo" to locate dependent dylibs. Thus
|
|
|
the RPATH mechanism comes into play. The linker will search for `@rpath`/
|
|
|
dependencies in the following order:
|
... | ... | @@ -271,7 +271,7 @@ CMake RPATH-related variables. |
|
|
|
|
|
On Linux, one may use
|
|
|
|
|
|
``` bash
|
|
|
```shell
|
|
|
objdump -x executable_or_lib.so|grep RPATH
|
|
|
```
|
|
|
|
... | ... | |