How to link against debug versions of libc and libstdc++ in GCC?

后端 未结 2 1752
一生所求
一生所求 2020-12-14 18:44

I am aware of this question, but it does not appear to work for me.

For the setup, take a simple C++ program, hw.cpp, given by: int main() { }

相关标签:
2条回答
  • 2020-12-14 19:08

    Your program gets linked to debug libs.

    Only the 'ldd ./hw' is finding the libstdc++ in standard location. For that you need to change LD_LIBRARY_PATH to get the debug shared libraries to load and ldd to find them properly.

    0 讨论(0)
  • 2020-12-14 19:09

    On many Linux installations the debug libraries do not contain real code; they only contain the debug info. The two are separated so that you can choose not to install them if you don't need them and you are short of disk space, but the debug libraries are no good on their own.

    GDB is normally preconfigured to find the debug libraries when you need them.

    Of course, your system maybe different. You don't say what it is.

    0 讨论(0)
提交回复
热议问题