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
python26_d.lib
DEBUG
Based on all answers I successfully disabled _DEBUG temporary:
_DEBUG
#if _DEBUG #define _DEBUG_IS_ENABLED #undef _DEBUG #endif #include "pyconfig.h" #if defined(_DEBUG_IS_ENABLED) #define _DEBUG #endif