Debugging shared C++ libs on Linux [message #204818] |
Wed, 14 November 2007 00:06 ![Go to next message Go to next message](theme/Solstice/images/down.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
Originally posted by: bje_web.comcast.net
I'm using the following versions of programs:
gcc version 4.1.1 20070105 (Red Hat 4.1.1-52)
Eclipse 3.3.0
CDT 4.0.1
I'm starting with a very simple C++ program, one library and an executing
program. When I build the library as a static debug version, the
debugging works great. When I build the library as a shared debug
version, the Run works fine but I get an ... 'error while loading shared
libraries' ... 'cannot open shared object file: No such file or directory'
when running Debug. I've set the following:
Debug Dialog:
Environment - Added path to shared library to start of LD_LIBRARY_PATH
Debugger > Shared Libraries - Added path
I've tried some of the other options but debug cannot find any that get me
running. I can run the debug version on the command line with the
LD_LIBRARY_PATH set.
I also tried running gdb from the command line. I set the LD_LIBRARY_PATH
but get the error while loading shared libraries error. I can set the
solib-search-path but still get the error. The only way around the error
when running gdb from the command line that I've found is to move the
libxx.so file into the directory I'm running gdb in.
I've searched the web for this issue. I see similar problems but cannot
find a solution to my problem. I'm starting with this example but really
want to use eclipse to debug some shared libraries in a pretty complex
environment.
Thanks for any suggestions.
Betty
|
|
|
|
Re: Debugging shared C++ libs on Linux [message #204925 is a reply to message #204911] |
Wed, 14 November 2007 23:23 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) ![Go to next message Go to next message](theme/Solstice/images/down.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
Originally posted by: bje_web.comcast.net
Alex
Thanks for the response. I found the problem. I wasn't setting the
LD_LIBRARY_PATH in my .cshrc file, just locally on the command line.
Previously I could only run gdb from the command line successfully if my
so file was in the same directory as my executable. When the gdb process
started, it didn't have the correct LD_LIBRARY_PATH. Once I set the
LD_LIBRARY_PATH in my .cshrc, both gdb and eclipse worked fine.
I thought that setting LD_LIBRARY_PATH in the Eclipse Run Dialog
Environment and/or the Debugger > Shared Libraries > Directories would
take care of everything. It looks like neither of these had any effect
when running in debug (interesting).
Thanks!
Betty
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04541 seconds