Please can anyone explain in beginner's language what is LD_LIBRARY_PATH (unix)?

I just installed SPIKEfile (fuzzer) on Ubuntu and it says the following:

Now you need to set LD_LIBRARY_PATH to include the path to libdisasm.so and the path to libdlrpc.so

'printenv' indicates that such a variable does not exist.

Can someone please kindly explain to me in beginners what this really means and how to solve the problem. I am a pretty inexperienced Linux user. Thanks in advance.

PS I found most of the things on the network useless, and I would prefer not to copy + paste, not knowing what I'm doing.

+4
source share
2 answers

Linux has the concept of shared libraries, that is, code libraries that are not baked into executable files, but are instead dynamically linked during program execution. The executable simply contains links to the names of the required libraries.

LD_LIBRARY_PATH is an environment variable that lists additional paths that the Linux boot time linker should use when searching for these libraries. This is just a colon separated list of the form

 /path/to/somewhere:/path/to/somewhere_else:/path/to/narnia 

Assuming you are using Bash, you can do the following to add additional paths to the list (this works even if $LD_LIBRARY_PATH initially empty or not set):

 export LD_LIBRARY_PATH=/path/to/dir/containing/libdisasm.so:$LD_LIBRARY_PATH 

(and similarly for libdlrpc.so).

+4
source

I used LD_LIBRARY_PATH on Solaris, as it seems that some libraries are missing when scripts are sometimes kicked. Having this variable set at the beginning of the script is simply a safer way to work it.

Something worth mentioning (maybe you're looking):

 ldd /path/to/narnia export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/path/to/dir/containing/lib 

(make sure not to lose the previously installed directory)

Should work when reusing the command:

 ldd /path/to/narnia librt.so.1 => /lib/librt.so.1 (0x00002b4eca08e000) libc.so.6 => /lib/libc.so.6 (0x00002b4eca49f000) libpthread.so.0 => /lib/libpthread.so.0 (0x00002b4eca7df000) /lib64/ld-linux-x86-64.so.2 (0x00002b4ec9e72000) libmylib.so.1 => ~/myprogdir/lib/libmylib.so.1 (0x00002b4eca9fa000) 

This will lead to an error, if you can not find lib, do not forget to add the settings to your user profile:

 # vi .bash_profile 
+1
source

All Articles