Compiling python modules whith DEBUG defined on MSVC

Posted by DaedalusFall on Stack Overflow See other posts from Stack Overflow or by DaedalusFall
Published on 2009-08-05T22:16:28Z Indexed on 2010/03/16 13:16 UTC
Read the original article Hit count: 445

Filed under:
|
|

Python rather stupidly has a pragma directive in its include files that forces a link against python26_d.lib when the DEBUG preprocessor variable is defined. This is a problem because the python installer doesn't come with python26_d.lib! So I can't build applications in msvc in debug mode. If i temporarily #undef DEBUG for just one file I get many complaints about inconsistent DLL linkage. If I change the pragma in pythons include file I get undefined references to various debug functions.

I have tried compiling my own version of python but its somehow different enough from the python that gets distributed that I can't use my modules with apps built with the vanilla version of python

Can anyone give me any advice on how to get round this?

Thanks

© Stack Overflow or respective owner

Related posts about python

Related posts about debug