W32pragma.h and BOOST

In building code with ROOT 5.20/00, VC++ 2005, and BOOST v1.35.0, if I do not include w32pragma.h as a forced include I get compilation errors from ROOT. If I do include it, then the code builds but on execution I get crashes from BOOST calls. I have verified that test code with only a few BOOST calls and no ROOT calls executes without including w32pragma.h, and it reproduces my crash after force-including w32pragma.h.

For example, the BOOST method


seems to suffer from this incompatibility.

Is there a way around this?

I think I understand the problem - BOOST needs to be built with settings compatible with w32pragma.h. I rebuilt BOOST using

bjam.exe --build-type=complete toolset=msvc-8.0 threading=multi define=G__NEWSTDHEADER=1 define=_CRT_SE

and my code builds and executes without errors.


well done, thanks for posting the solution! This mess is caused by Microsoft having an incompatible STL interface for debug and release builds that we (and many other people, too) work around by forcing the MS STL implementation to re-use the release version even in debug builds. Your original build of boost was using the (incompatible) debug implementation which was causing the failures you saw.

Cheers, Axel.