I've already read gdb says "cannot open shared object file" and gdb can not open shared object file and followed the instructions.
I have a binary which is linked to a shared library file (/zzz/yyy/xxx.so
). After I set LD_LIBRARY_PATH
to /zzz/yyy/
and run the binary without GDB, it executes very well.
However, when I was trying to use GDB to debug this binary, GDB says:
error while loading shared libraries: xxx.so: cannot open shared object file: No such file or directory
I already have (set in .gdbinit):
(gdb)show env LD_LIBRARY_PATH
LD_LIBRARY_PATH = "/zzz/yyy/"
and
(gdb) show solib-search-path
The search path for loading non-absolute shared library symbol files is "/zzz/yyy/".
and in my system:
% printenv LD_LIBRARY_PATH
/zzz/yyy
What's the other possible reasons why GDB still can't find this shared library?