« Return to Thread: problems with python24_d.lib

problems with python24_d.lib

by Bob Marinier :: Rate this Message:

Reply to Author | View in Thread

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

This "tricks" Python.h into thinking this is not a debug build, and thus
is looks for python24.lib instead, which does exist.  This works, and
since I'm not trying to debug Python, I don't care that I'm not linking
the debug library.  But having to manually change SWIG's output each
time I generate it is a real pain.  Is there either a way to change
SWIG's output to this or does anyone have another idea for how to
workaround this problem?  And no, renaming python24.lib to
python24_d.lib does not work :) (they aren't binary compatible).

Thanks,
Bob Marinier


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

 « Return to Thread: problems with python24_d.lib