I'm trying to debug a program i wrote in 开发者_运维百科c++ using eclipse but i am encountering a problem when choosing the debug option.
/home/dupinf/workspace/HashTest/Debug/HashTest:
/sw/st/gnu_compil/gnu/linux-rh-ws-4-x86_64/lib64/libstdc++.so.6:
version `GLIBCXX_3.4.15' not found
when I just run the release, it works smoothly. But when i try to go debug mode i get the error. I don't understand why it wouldn't find the library in one mode and not in the other
What shall i change in order to be able to debug and use the breakpoints ?
So I found what was the problem :
1) Go to the launch configuration for my debug
2) Go to the environment tab
3) Add the LD_LIBRARY_PATH variable with the path to my library
4) check the box to overwrite exist variable.
Then i can debug smoothly.
Note that even if you have modified you LD_LIBRARY_PATH in your terminal, it is not taken into account in debug mode but just in run mode.
hope it can help someone ;)
When linking with external libraries, keep in mind that the libraries are built in either release or debug modes. When a library is built in debug mode it contains all the debugging symbols/info that a debugger hooks into to monitor the state of the application. If you are trying to build a debug version of an application and you link to the release version - this will cause a problem (as the lib you are linking with is organized differently in either the release or debug versions of the lib). The solution: rebuild the external libraries in debug mode, and link against those
精彩评论