I have debug versions of libstdc++ and libc, among others, and would like to link against them. They live in /usr/lib/debug as opposed to /usr/lib. Any ideas?
views:
33answers:
1
+2
A:
Assuming Linux,
- Static libraries: add a
-L/usr/lib/debug
to your linker command line.gcc
/ld
will look there before default system directories. Useldd
command to verify that correct library versions were linked against (shared libraries only). - Shared libraries: set
LD_LIBRARY_PATH=usr/lib/debug
, and your application will pick up libraries from there even without step 1, as long as there is a version of a library, which is very likely if you are installing with distribution's package manager.
It's a good idea to do both, though, as some libraries may be only in static form.
Alex B
2010-07-02 00:12:08
That works, but I guess I have to change the LD_LIBRARY_PATH to get the debug shared libraries to load, right?
Jonathan Fischoff
2010-07-04 19:13:06
@Jonathan Fischoff, if you are linking against shared libraries, yes.
Alex B
2010-07-04 22:59:29