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

Jérôme Laheurte fraca7 at free.fr
Tue Jun 7 10:27:46 CEST 2011

On 06/07/2011 09:59 AM, Lars Viklund wrote:

> 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.

So the old Mingw 3.x runtime was compatible with the Visual 6 one but 
not the 4.5 one... Thanks for the suggestion; I'll try to get Python to 
build with GCC 4.5 and see if it fixes the issue.


More information about the Cplusplus-sig mailing list