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
export LD_LIBRARY_PATH=/mnt/sda5/Programming/misc/src/
to the libmisc.so
output path.
Debugging from console works fine:
gdb mainx
However from Emacs22, launching gdb fails with the following message:
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
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.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…