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?
Assuming Linux,
-L/usr/lib/debug
to your linker command line. gcc
/ld
will look there before default system directories. Use ldd
command to verify that correct library versions were linked against (shared libraries only).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.