« Return to Thread: problems with python24_d.lib

Re: problems with python24_d.lib

by Sohail Somani :: Rate this Message:

Reply to Author | View in Thread

> -----Original Message-----
> From: swig-user-bounces@...
> [mailto:swig-user-bounces@...] On Behalf Of
> Bob Marinier
> Sent: Wednesday, June 07, 2006 1:41 PM
> To: swig-user@...
> Subject: [Swig-user] problems with python24_d.lib
>
> Hi,
>
> I'm wrapping some code for Python on Windows using Visual Studio 2005
> (although I think this will all be exactly the same in 6 and 2003).
>
> When I'm doing a debug build, the symbol _DEBUG is defined
> (and it needs
> to be defined).  Something in Python.h, then, tells the
> linker it needs
> python24_d.lib.  The problem is that the Windows installer for Python
> does not include this file.  One possible workaround I found on the
> Python mailing list is to change the SWIG output so that
>
> #include "Python.h"
>
> becomes:
>
> #ifdef _DEBUG
>   #undef _DEBUG
>   #include "Python.h"
>   #define _DEBUG
> #else
>   #include "Python.h"
> #endif

Could you do something like this for debug builds:

cl ... /U_DEBUG /D_REALLY_DEBUG lib_wrap.cc

In lib.i:

%module lib;
%{
#ifdef _REALLY_DEBUG
# define _DEBUG
#endif
%}

Haven't tried it, but maybe it'll work


_______________________________________________
Swig-user mailing list
Swig-user@...
https://lists.sourceforge.net/lists/listinfo/swig-user

 « Return to Thread: problems with python24_d.lib