[C++-sig] Building Boost.Python against a debug build of Python

Adam Preble adam.preble at gmail.com
Wed Feb 15 16:38:38 CET 2012

I previously posted about runtime oddness when switching to a debug build
of python.  I figured I needed to rebuild Boost.Python.  The build process
is fixated on using the normal python.exe and python.lib paths, rather than
python_d.exe and python_d.lib.  I have put those files in my Python26
directory, and then tried to get fancy by renaming them to their release
names instead.  It gets mad at me . . .

 Creating library
and object
module.obj : error LNK2019: unresolved external symbol
__imp__Py_InitModule4 referenced in function "struct _object * __cdecl
boost::python::detail::init_module(char const *,void (__cdecl*)(void))"
(?init_module at detail@python at boost@@YAPAU_object@@PBDP6AXXZ at Z)
: fatal error LNK1120: 1 unresolved externals

I'm thinking that isn't what I'm supposed to do anyways.  Is there
something I need to do in my build string?  This is how I would do a full
build.  Note all the baggage I added for building Python:

[FWIW I'm building Boost 1.47 with VS2010's toolchain]

set INCLUDE=D:\Python26\include;D:\Python26\include\Stackless
b2 --toolset=msvc-10.0 --build-type=complete stage
b2 --toolset=msvc-10.0 --build-type=complete architecture=x86
address-model=32 stage
b2 --toolset=msvc-10.0 --with-python --build-type=complete
--debug-configuration architecture=x86 address-model=32 stage
debug-symbols=on debug-store=database python-debugging=on
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/cplusplus-sig/attachments/20120215/52f4bbf9/attachment.html>

More information about the Cplusplus-sig mailing list