Compiling python modules with DEBUG defined on MSVC Compiling python modules with DEBUG defined on MSVC python python

Compiling python modules with DEBUG defined on MSVC


From python list

As a workaround to the situation, try to copy the file python26.dll to python26_d.dll. (I'm not sure this will work; you say you are building a SWIG library in debug mode, and it's possible that SWIG will try to use features of the Python debugging version. If that's the case, you'll have no choice but to use the debugging version of Python.)

Edit: From comments:

You should also edit pyconfig.h and comment out the line "#define Py_DEBUG" (line 374)


After you comment out "#define Py_DEBUG" on line 332 and modify

#   ifdef _DEBUG#    pragma comment(lib,"python26_d.lib")#   else

to

#   ifdef _DEBUG#    pragma comment(lib,"python26.lib")#   else

you do not need to python26_d.lib anymore.


You can also go the other way: switch to «Release» and then debug it. you need to enable generation of debugging symbols info in project properties in compiler and linker prefs; MSDN here will tell you exactly what options you need to set to debug a release build.