Mixing debug and release library/binary - bad practice?

前端 未结 3 1568
名媛妹妹
名媛妹妹 2020-11-27 05:07

Is it a bad practice to use a release version of 3rd party library in debug binary?

I am using a 3rd party library and compiled a release .lib library. My exe is in

3条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-11-27 06:00

    The fact that it doesn't compile should be sufficient to prove it's bad practice.

    Regarding maintaining separate builds - you don't need to do that. Here's a workaround that previously worked for me:

    #ifdef _DEBUG
    #define DEBUG_WAS_DEFINED
    #undef _DEBUG
    #endif
    
    #include 
    
    #ifdef DEBUG_WAS_DEFINED
    #define _DEBUG
    #endif
    

    Let me know if this works for you.

提交回复
热议问题