Compiling python modules with DEBUG defined on MSVC

前端 未结 5 1590
我寻月下人不归
我寻月下人不归 2020-12-14 02:08

Python rather stupidly has a pragma directive in its include files that forces a link against python26_d.lib when the DEBUG preprocessor variable i

5条回答
  •  情深已故
    2020-12-14 02:45

    Based on all answers I successfully disabled _DEBUG temporary:

    #if _DEBUG
      #define _DEBUG_IS_ENABLED
      #undef _DEBUG
    #endif
    #include "pyconfig.h"
    #if defined(_DEBUG_IS_ENABLED)
      #define _DEBUG
    #endif
    

提交回复
热议问题