[C++-sig] Re: -sBUILD=debug-python

David Abrahams dave at boost-consulting.com
Thu Nov 18 21:29:38 CET 2004

Stefan Quandt <Stefan.Quandt at bardenheuer.de> writes:

> David Abrahams wrote:
>> Stefan Quandt <Stefan.Quandt at bardenheuer.de> writes:
>>> David Abrahams wrote:
>>>> Stefan Quandt <Stefan.Quandt at bardenheuer.de> writes:
>>>>> I try to build an extension with python-debug on Win32.
>>>>> I compiled a debug version of the Python interpreter from source and
>>>>> adjusted PYTHON_ROOT in my Jamrules to it's location.
>>>>> Then I try to build my extendions with
>>>>>   bjam -sBUILD=python-debug
>>>>> When bjam tries to link boost_python.dll it complains not finding
>>>>> "python23.lib".
>>>>> As far as I know it should be "python23_d.lib".
>>>>> Or am I missing something?
>>>>    bjam -sBUILD=debug-python
>>>>                 ^^^^^^^^^^^^
>>> Ah, yes, that's what I did.
>>> It's only written wrong in my posting.
>>> Why dows bjam references the non-debug version python23.lib when linking
>>> boost_python.dll?
>> Oh
>> , that's why. 
>> You have to link with boost_python_pydebug.lib/.dll (or the
>> boost_python.lib/.dll that's created in a path including
>> .../debug-python/...) if you want to use Python debug mode.
> As I wrote bjam tries to create a normal "boost_python.dll"

That's fine, if you're using the method in
libs/python/example/Jamfile as you say.  That boost_python.dll is
actually compiled against the "_d" version of the Python library.

>> Of course, if you use the method in libs/python/example/Jamfile you
>> won't have this problem
> In fact my Jamfile is derived from the given example and it's very similar
> in structure.
> My extension target rule differs only in 
>  1) specifying multiple files in the source argument and
>  2) having a requirements argument with <library-path> and <find-library>
> items).

What libraries are you looking for?  I hope not Python or boost_python!

> So what "mechanism" would bjam bring to create
> boost_python_pydebug.lib/.dll?
> After reading
>   file:/home/qua/boost-2004-07-05/libs/python/doc/building.html#variants
> I assumed it would be as simple as using the "-sBUILD=debug-python" option.

That file only gets created when you build the "bin-stage" target, I

Dave Abrahams
Boost Consulting

More information about the Cplusplus-sig mailing list