STL and release/debug library mess

前端 未结 4 1891
梦毁少年i
梦毁少年i 2021-02-05 23:23

I\'m using some 3rd party. I\'m using it\'s shared library version, since the library is big (~60MB) and is used by several applications.

Is there a way at application s

4条回答
  •  忘掉有多难
    2021-02-06 00:07

    The debug mode referenced here has nothing to do with debug or release build of your application. The STL debug mode is activated with -D_GLIBCXX_DEBUG and is a special checking mode.

    It is very unlikely that the 3rd party library was in fact compiled with STL checking mode, but if it was, it would likely very promptly mention that your code should also be compiled with -D_GLIBCXX_DEBUG.

    If the 3rd party library was not built with checking STL, then it is compatible with your code regardless of whether you are doing optimized or debug build.

    Since you state that debug build of your code linked with optimized build of 3rd party library causes a crash, that crash is most likely caused by a bug in your code (or possibly by a bug in 3rd party library).

    Valgrind and GDB are your friends.

提交回复
热议问题