作者:漫猪傻滑_679 | 来源:互联网 | 2023-05-19 06:50
Ihaveonebinaryandonesharedlibrary.Thesharedlibraryiscompiledwith:我有一个二进制文件和一个共享库。共享库编译
I have one binary and one shared library. The shared library is compiled with:
我有一个二进制文件和一个共享库。共享库编译为:
all:
g++ -g -shared -fpic $(SOURCES) -o libmisc.so
the binary is compiled with:
二进制编译用:
LIBS=-L../../misc/src
LDFLAGS=-lmisc
all:
g++ -g -o mainx $(INCLUDE) $(SOURCE) $(LIBS) $(LDFLAGS)
I set in ~/.bashrc
我在〜/ .bashrc中设置
export LD_LIBRARY_PATH=/mnt/sda5/Programming/misc/src/
to the libmisc.so
output path.
到libmisc.so输出路径。
Debugging from console works fine:
从控制台调试工作正常:
gdb mainx
However from Emacs22, launching gdb fails with the following message:
但是,从Emacs22启动gdb失败,并显示以下消息:
Starting program: /mnt/sda5/Programming/main/src/mainx /mnt/sda5/Programming/main/src/mainx: error while loading shared libraries: libmisc.so: cannot open shared object file: No such file or directory
启动程序:/ mnt / sda5 /编程/ main / src / mainx / mnt / sda5 /编程/ main / src / mainx:加载共享库时出错:libmisc.so:无法打开共享对象文件:没有这样的文件或目录
This looks very tricky for the moment, and I couldn't solve it. I am not sure if this a emacs's problem, or I should pass a parameter in gdb's command line.
这一刻看起来很棘手,我无法解决它。我不确定这是否是emacs的问题,或者我应该在gdb的命令行中传递一个参数。
3 个解决方案