[C++-sig] [boost.python] Debug build on win32 runtime trouble

Thomas Berg merlin66b at gmail.com
Thu Sep 18 20:44:03 CEST 2008


On Thu, Sep 18, 2008 at 7:50 AM, Olaf Peter <ope-devel at gmx.de> wrote:
> Hi,
>
> I run into trouble on my debug build on windows, which works fine on linux.
> The interesting point is, that it does crash in python.dll and not
> python_d.dll.
>
> Depency walker shows:
>
> d:\work\...\build\debug\PYTHON25_D.DLL
> d:\work\...\build\debug\BOOST_PYTHON-VC80-MT-GD-1_35.DLL
> + c:\windows\system32\PYTHON25.DLL
>
> Here we are.
>
> I've used cmake and compile flags:
>
> /Od /I .... /D "WIN32" /D "_WINDOWS" /D "_DEBUG" /D
> "BOOST_ENABLE_ASSERT_HANDLER=1" /D "BOOST_ALL_DYN_LINK" /D
> "BOOST_LIB_DIAGNOSTIC" /D "BOOST_DEBUG_PYTHON" /D "QT_DLL" /D "QT_GUI_LIB"
> /D "QT_CORE_LIB" /D "QT_DEBUG" /D "CMAKE_INTDIR=\"Debug\"" /D "_MBCS" /FD
> /EHsc /RTC1 /MDd /Fo"eda.dir\Debug\\" /Fd"D:/work/.../build/Debug/eda.pdb"
> /W3 /nologo /c /Zi /TP /errorReport:prompt
>
> Note the BOOST_DEBUG_PYTHON define. As linker flags I've used:
>
> /OUT:"D:\work\...\build\Debug\eda.exe" /VERSION:0.0 /INCREMENTAL /NOLOGO
> /LIBPATH:"optimized\Debug" /LIBPATH:"optimized"
> /LIBPATH:"C:\Cpp\boost_1_35_0\lib\boost_iostreams-vc80-mt-1_35.lib\Debug"
> /LIBPATH:"C:\Cpp\boost_1_35_0\lib\boost_iostreams-vc80-mt-1_35.lib"
> /LIBPATH:"debug\Debug" /LIBPATH:"debug"
> /LIBPATH:"C:\Cpp\boost_1_35_0\lib\Debug" /LIBPATH:"C:\Cpp\boost_1_35_0\lib"
> /LIBPATH:"C:\Programme\Python25\libs\Debug" /MANIFEST
> /MANIFESTFILE:"eda.dir\Debug\eda.exe.intermediate.manifest" /DEBUG
> /PDB:"D:/work/.../build/Debug/eda.pdb" /SUBSYSTEM:WINDOWS
> /IMPLIB:"D:\work\...\build\Debug\eda.lib" /ERRORREPORT:PROMPT kernel32.lib
> user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib
> uuid.lib comdlg32.lib advapi32.lib
> C:\Cpp\qt-win-opensource-4.4.1-msvc2005\lib\qtmaind.lib
> C:\Cpp\qt-win-opensource-4.4.1-msvc2005\lib\QtGuid4.lib imm32.lib winmm.lib
> C:\Cpp\qt-win-opensource-4.4.1-msvc2005\lib\QtCored4.lib ws2_32.lib
> python25_d.lib C:\Cpp\boost_1_35_0\lib\boost_python-vc80-mt-gd-1_35.lib
> C:\Cpp\boost_1_35_0\lib\boost_program_options-vc80-mt-gd-1_35.lib
> C:\Cpp\boost_1_35_0\lib\boost_thread-vc80-mt-gd-1_35.lib
> C:\Cpp\boost_1_35_0\lib\boost_filesystem-vc80-mt-gd-1_35.lib
> C:\Cpp\boost_1_35_0\lib\boost_iostreams-vc80-mt-gd-1_35.lib
>
> for MS VS 2005 (MSVC 8.0)
>
> Did I miss something on win32??
>
> Thanks,
> Olaf
> _______________________________________________
> C++-sig mailing list
> C++-sig at python.org
> http://mail.python.org/mailman/listinfo/c++-sig
>


To get a pure python-debug build you need to explicitly tell boost to
link to the debug version of python, by passing the option
python-debugging=on to bjam when building boost. You will ghen get
boost_python-vc80-mt-gyd-1_35.lib and .dll instead, and need to link
to that.

You also need to define BOOST_DEBUG_PYTHON when you build your
application, see this url:
http://www.boost.org/doc/libs/1_36_0/libs/python/doc/building.html#python-debugging-builds

Hope this helps!
Thomas



More information about the Cplusplus-sig mailing list