[C++-sig] A very strange behaviour of Boost (Mingw, gcc 4.5)

Lars Viklund zao at acc.umu.se
Tue Jun 7 09:59:27 CEST 2011


On Tue, Jun 07, 2011 at 09:40:25AM +0200, Jérôme Laheurte wrote:
> Hello. I already asked this on StackOverflow but it doesn't seem to  
> inspire many people. I managed to reduce my problem to a trivial  
> extension module:

> On Windows XP SP3, if I build Boost 1.46.1 and then this extension with  
> GCC 3.4.5 from an older version of Mingw, everything behaves as expected:

> Now if I rebuild both Boost and the module using a newer Mingw, with GCC  
> 4.5.2, this happens:

> Any hint would be greatly appreciated.

Typically, you need to use the same major flavor of toolchain to build
Boost.Python and your extension as was used to build your Python.

If the runtimes (and exception handling) differ, you'll get ODR
violations on things like FILE* and error handling.

What you're observing there is probably console output crashing when an
error is printed. If the runtimes have different ideas of what
constitutes a FILE* (which output is done through), you blow up good.
This also includes using static runtimes to some extent.

-- 
Lars Viklund | zao at acc.umu.se


More information about the Cplusplus-sig mailing list