Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ldd says "not found" even though library is in my LD_LIBRARY_PATH

Tags:

linux

$ ldd libpmsfdcwrt.so
        linux-gate.so.1 =>  (0x004ae000)
        libdl.so.2 => /lib/libdl.so.2 (0x00417000)
        [ ... elided ... ]
        libz.so.1 => not found
        [ ... elided ... ]
        libpmssl.so.0.9.7 (0xf5be8000)
        libfreebl3.so => /usr/lib/libfreebl3.so (0xf5b88000)

Note "libz.so.1 => not found".

But libz.so.1 exists:

$ ls -l /lib64/libz.so.1
lrwxrwxrwx 1 root root 13 Apr 25  2013 /lib64/libz.so.1 -> libz.so.1.2.3
$ ls -l /lib64/libz.so.1.2.3
-rwxr-xr-x 1 root root 91096 Oct  3  2012 /lib64/libz.so.1.2.3

And, that directory is listed in LD_LIBRARY_PATH:

$ echo $LD_LIBRARY_PATH
:/oracle/product/11.2.0/client_1/lib:/opt/CA/CAlib:/usr/local/CAlib:/opt/CA/WorkloadAutomationAE/autosys/lib:/opt/auto/ixpagent/lib:/lib64:/opt/CA/SharedComponents/lib:/usr/lib:/opt/CA/SharedComponents/Csam/SockAdapter/lib

(I logged out and logged back in to be sure it was sticking.)

like image 479
jsf80238 Avatar asked Aug 14 '14 18:08

jsf80238


People also ask

Does Ld use LD_LIBRARY_PATH?

LD_LIBRARY_PATH tells the dynamic link loader (ld. so – this little program that starts all your applications) where to search for the dynamic shared libraries an application was linked against.

What does LD_LIBRARY_PATH mean?

The LD_LIBRARY_PATH environment variable tells Linux applications, such as the JVM, where to find shared libraries when they are located in a different directory from the directory that is specified in the header section of the program.

How do I set LD_LIBRARY_PATH?

In your terminal, type the following sudo ldconfig and press enter on your keyboard. Close all your open terminals that you were using then open a new terminal session and run echo $LD_LIBRARY_PATH If you see the path you added is echoed back, you did it right.

What does ldd output mean?

ldd (List Dynamic Dependencies) is a *nix utility that prints the shared libraries required by each program or shared library specified on the command line. It was developed by Roland McGrath and Ulrich Drepper. If some shared library is missing for any program, that program won't come up.


1 Answers

The problem was a 32-bit/64-bit collision:

$ file libpmsfdcwrt.so
libpmsfdcwrt.so: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically linked, not stripped

$ file /lib64/libz.so.1.2.3
/lib64/libz.so.1.2.3: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, stripped

Thank you, everyone, for pointing me in the correct direction.

like image 71
jsf80238 Avatar answered Sep 20 '22 13:09

jsf80238