gdb 无法打开共享对象文件 [英] gdb can not open shared object file
本文介绍了gdb 无法打开共享对象文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试从控制台开始调试我的应用程序.
I am trying to debug my application starting from console.
> gdb ./Geod
然后在 gdb 中
(gdb) run
我得到了输出:
error while loading shared libraries: libGeo.Cored.so.1:
cannot open shared object file: No such file or directory
系统配置如下:
> echo $LD_LIBRARY_PATH
/home/paceholder/projects/geo/lib/debug
> ls $LD_LIBRARY_PATH
libGeo.Cored.so.1.0.0
libGeo.Cored.so
libGeo.Cored.so.1
libGeo.Cored.so.1.0
(gdb) show solib-search-path
The search path for loading non-absolute shared library symbol files is
/home/paceholder/projects/geo/lib/debug.
推荐答案
您可以在 gdb 中使用 set environment
命令来更改 gdb 用于启动您要调试的程序的环境.摘自 gdb 帮助:
You can use the set environment
command in gdb to change the environment gdb uses to launch the program you want to debug. Extract from the gdb help:
(gdb) help set environment
Set environment variable value to give the program.
Arguments are VAR VALUE where VAR is variable name and VALUE is value.
VALUES of environment variables are uninterpreted strings.
This does not affect the program until the next "run" command.
LD_LIBRARY_PATH
示例:
(gdb) set environment LD_LIBRARY_PATH /home/paceholder/projects/geo/lib/debug
这篇关于gdb 无法打开共享对象文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文