The build process for Boost is currently undergoing some evolution, and, it is to be hoped, improvement. The following facts may help:
When extension modules are built with Visual C++ using -D_DEBUG, Python defaults to force linking with a special debugging version of the Python DLL. Since this debug DLL isn't supplied with the default Python installation for Windows, Boost.Python uses boost/python/detail/wrap_python.hpp to temporarily undefine _DEBUG when Python.h is #included.
If you want the extra runtime checks available with the debugging version of the library, #define BOOST_DEBUG_PYTHON to re-enable library forcing, and link with the DebugPython version of boost_python.lib. You'll need to get the debugging version of the Python executable (python_d.exe) and DLL (python20_d.dll or python15_d.dll). The Python sources include project files for building these. If you download them, change the name of the top-level directory to src, and install it under c:\tools\python, the workspace supplied by Boost.Python will be able to use it without modification. Just open c:\tools\python\src\pcbuild\pcbuild.dsw and invoke "build all" to generate all the debugging targets.
If you do not #define BOOST_DEBUG_PYTHON, be sure that
any source files #include <boost/python/detail/wrap_python.hpp>
instead of the usual Python.h, or you will have link
incompatibilities.
Next: Wrapping Enums Previous: A Peek Under the Hood Up: Top
© Copyright David Abrahams 2000. Permission to copy, use, modify, sell and distribute this document is granted provided this copyright notice appears in all copies. This document is provided ``as is'' without express or implied warranty, and with no claim as to its suitability for any purpose.
Updated: Mar 6, 2001