Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Program does not find so library, even though ldconfig knows about it

The path to libidl.so.7.1 is in ld.so.conf, and the library is in the cache as well:

$ /sbin/ldconfig -p | grep libidl.so.7.1
    libidl.so.7.1 (libc6) => /opt/itt/idl71/bin/bin.linux.x86/libidl.so.7.1

However, for some reason it is not found by ldd:

$ ldd _pyIDLmodule.so | grep libidl.so.7.1
    libidl.so.7.1 => not found

Yet if I explicitly add the path to LD_LIBRARY_PATH, it works:

$ export LD_LIBRARY_PATH=/opt/itt/idl71/bin/bin.linux.x86_64/
$ ldd _pyIDLmodule.so | grep libidl.so.7.1
libidl.so.7.1 => /opt/itt/idl71/bin/bin.linux.x86_64/libidl.so.7.1 (0x00002b7428ee7000)

What am I doing wrong? Why isn't ldd finding the library?

like image 374
Nikratio Avatar asked Apr 06 '10 16:04

Nikratio


People also ask

Where can I find .so file?

These files are normally stored in /lib/ or /usr/lib/. On an Android device, SO files are stored within the APK under /lib//.

What does Ldconfig command do?

ldconfig creates the necessary links and cache to the most recent shared libraries found in the directories specified on the command line, in the file /etc/ld. so.

Where is the Ldconfig file?

The ldconfig command creates a cache database of all libraries based on the configuration file. This cache is normally stored in the /etc/ld.

Could not load library Cannot open shared object file no such file or directory?

cannot open shared object file: No such file or directory The reason behind this error is that the libraries of the program have been installed in a place where dynamic linker cannot find it.


1 Answers

You export a .x86_64 yet the config -p shows a .x86 (no _64)

I'm not sure if this matters or not, but I thought it curious.

like image 72
David Harkness Avatar answered Nov 15 '22 08:11

David Harkness