对于这个问题,我将使用一个特定的示例,但实际上,它可以推广到Linux上几乎找不到其依赖库的任何二进制文件。因此,我有一个由于缺少库而无法运行的程序:
./cart5: error while loading shared libraries: libcorona-1.0.2.so: cannot open shared object file: No such file or directory
ldd阐明了这个问题:
linux-vdso.so.1 => (0x00007fff18b01000)
libcorona-1.0.2.so => not found
libstdc++.so.6 => /usr/lib/gcc/x86_64-pc-linux-gnu/4.4.3/libstdc++.so.6 (0x00007f0975830000)
libm.so.6 => /lib/libm.so.6 (0x00007f09755af000)
libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x00007f0975399000)
libc.so.6 => /lib/libc.so.6 (0x00007f0975040000)
libz.so.1 => /lib/libz.so.1 (0x00007f0974e2b000)
/lib64/ld-linux-x86-64.so.2 (0x00007f0975b36000)
但是,已安装电晕:
oliver@human$ find / -name libcorona-1.0.2.so 2> /dev/null
/usr/local/lib64/libcorona-1.0.2.so
/home/oliver/installed/corona-1.0.2/src/.libs/libcorona-1.0.2.so
我该如何告诉二进制文件在哪里寻找“丢失的”库?