GDB “cannot open shared object file” Issue

后端 未结 1 886
猫巷女王i
猫巷女王i 2021-01-28 03:50

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 li

相关标签:
1条回答
  • 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

    You are mistaken: it's not GDB that says that, it's the dynamic loader. GDB itself doesn't care what LD_LIBRARY_PATH is set to, it simply runs your program. But your program can not run.

    The most common cause: you are re-setting your LD_LIBRARY_PATH in your ~/.cshrc, and GDB runs your program in a separate shell, and that shell reads your .cshrc, so your program executes with incorrect environment.

    The fix is to make .cshrc not set LD_LIBRARY_PATH for non-interactive shells. See e.g. this answer.

    0 讨论(0)
提交回复
热议问题