How do I tell gcc (or ld) to link against debug versions of the standard c and c++ libraries

前端 未结 3 1341
陌清茗
陌清茗 2021-01-06 02:12

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?

3条回答
  •  梦谈多话
    2021-01-06 02:53

    Use linker flags. ld/gcc -L is important for link time only, regardless shared or static, you cannot link against library, if linker can't find it.

    For shared libraries environment variable LD_LIBRARY_PATH is important for start up time. Dynamic libraries loader ld.so and ld-linux.so will look up there when you start your application.

提交回复
热议问题