库存在,ldd却仍然报错 not found(The LDD still reports an error not found when the inventory is)

参考:https://stackoverflow.com/questions/25314983/ldd-says-not-found-even-though-library-is-in-my-ld-library-path

交叉编译环境里面gdb报错缺少libncurses.so.5。 而使用ldconfig -p | grep libncurses.so.5 却是能够找到的。

很可能是32位和64位冲突导致,库是64位的,而程序是32位的,可以用file分别确认下。

$ file libpmsfdcwrt.solibpmsfdcwrt.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

————————

参考:https://stackoverflow.com/questions/25314983/ldd-says-not-found-even-though-library-is-in-my-ld-library-path

GDB reports an error in the cross compilation environment, and libncurses. So. 5 is missing. Instead, use ldconfig – P | grep   Libncurses. So. 5 can be found.

< strong > it is likely to be caused by 32-bit and 64 bit conflicts. The library is 64 bit and the program is 32-bit. You can use file to confirm respectively

$ file libpmsfdcwrt.solibpmsfdcwrt.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