Reputation: 457
I've just installed SPIKEfile(fuzzer) on Ubuntu and it says the following:
Now you need to set your LD_LIBRARY_PATH to include the path to libdisasm.so and the path to libdlrpc.so
'printenv' reveals that no such variable exists.
Could someone please kindly explain to me in beginners terms what this actually means and how to solve the problem. I'm a pretty inexperienced Linux user. Thanks in advance.
P.S. I have found most stuff on the net to be unhelpful and I'd rather not copy+paste without knowing what I'm doing.
Upvotes: 5
Views: 2220
Reputation: 3584
I used LD_LIBRARY_PATH under Solaris since it seems some libraries are missing when kicking scripts sometimes. Having this variable set at the begining of a script is just a safer way to work it out.
Something worth mentioning (probably what you are looking for):
ldd /path/to/narnia
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/path/to/dir/containing/lib
(do it this way not to lose previously set dir)
Should the work when using the comand again:
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 throw you an error if still can't find the lib make sure to add the settings in your user profile:
# vi .bash_profile
Upvotes: 1
Reputation: 272517
Linux has the concept of shared libraries, i.e. libraries of code that aren't baked into executables, but instead are dynamically linked when the program is executed. The executable simply contains references to names of libraries that are required.
LD_LIBRARY_PATH
is an environment variable listing extra paths that the Linux load-time linker should use when locating these libraries. It's simply a colon-separated list of the form
/path/to/somewhere:/path/to/somewhere_else:/path/to/narnia
Assuming you're using Bash, you can do the following to prepend extra paths to the list (this works even if $LD_LIBRARY_PATH
is initially empty or unset):
export LD_LIBRARY_PATH=/path/to/dir/containing/libdisasm.so:$LD_LIBRARY_PATH
(and similarly for libdlrpc.so).
Upvotes: 5