Silly link question: python22_d.dll

Greg Landrum drgergl at mindspring.com
Mon Feb 25 13:03:33 EST 2002


"Courageous" <jkraska at san.rr.com> wrote in message
news:j74j7uomek4igopeoegk222pdm5u7v078p at 4ax.com...
>
> There is a school  of thought that binaries and documentation are
> what make a system complete and not the source. While it's not
> that big a deal at all, one shouldn't have to checkout and compile
> all of Python in order to straightforwardly develop C Extensions.
>

You don't really need to do this.  The easiest way to solve the problem is
something like the following:

#ifdef _DEBUG
#undef _DEBUG
#include <Python.h>
#define _DEBUG
#else
#include <Python.h>
#endif

Then you'll never have the problem of Python looking for _d versions of
DLLs.  Of course you also won't be able to trace into python itself when
you're debugging, but I rarely find myself wanting to do this.  If you want
the option of doing full-blown debugging, you can define a third build
target and do something like the following (from Boost Python):

#ifdef _DEBUG
# ifndef BOOST_DEBUG_PYTHON
#  undef _DEBUG // Don't let Python force the debug library just because
we're debugging.
#  define DEBUG_UNDEFINED_FROM_WRAP_PYTHON_H
# endif
#endif

#include <Python.h>

#ifdef DEBUG_UNDEFINED_FROM_WRAP_PYTHON_H
# undef DEBUG_UNDEFINED_FROM_WRAP_PYTHON_H
# define _DEBUG
#endif

hope this helps,
-greg







More information about the Python-list mailing list