<font face="arial, helvetica, sans-serif">Hi Dieter,</font><div><font face="arial, helvetica, sans-serif"><br></font></div><div><font face="arial, helvetica, sans-serif">I think we've narrowed down the problem to the fact that Mingw won't allow C++ exceptions to cross DLL boundaries unless all libraries are linking to a shared version of libgcc. See the gcc 4.6.2 release notes for details:</font></div>
<div><font face="arial, helvetica, sans-serif"><br>
</font></div><div><font face="arial, helvetica, sans-serif"><a href="http://sourceforge.net/projects/mingw/files/MinGW/Base/gcc/Version4/gcc-4.6.2-1/" target="_blank">http://sourceforge.net/projects/mingw/files/MinGW/Base/gcc/Version4/gcc-4.6.2-1/</a></font></div>

<div><font face="arial, helvetica, sans-serif"><br></font></div><div><font face="arial, helvetica, sans-serif">Linking to a shared version of libgcc is the default behavior for C++, however it looks like the R package build process overrides this in the gnuwin32 etc/Makeconf as follows:</font></div>
<div><font face="arial, helvetica, sans-serif"><br></font></div><div><font face="arial, helvetica, sans-serif"><div>DLLFLAGS+= -static-libgcc</div><div>LINKFLAGS+= -static-libgcc</div><div><br></div><div>I don't know if there is any way for a package to override this (nor whether that would be desirable in other dimensions that we're not aware of). </div>
<div><br></div><div>So, we need to investigate how we can prevent exceptions from ever crossing DLL boundaries. In the meantime you can use the explicit exception handling code that Dirk posted, but of course we are very keen to not have to require this boilerplate code on Windows. More later....</div>
<div><br></div><div>J.J.</div><div><br></div><div><br></div><div><br></div><div><br></div></font></div>