On 9/11/2010 01:22, Sébastien Villemot wrote: > Hi, > > After some experimentation, it appears that my problem is much more > generic than what I had initially thought, and has no relation to > MATLAB. It seems to systematically happen when a C++ exception is thrown > by a DLL compiled using Visual C++ (x64) and linked to an executable > compiled using MinGW-w64 (x64-targeted). > > I attach a small testcase that you should be able to reproduce, provided > that you have Visual C++ for x64 (I have the 2008 edition). > > First, compile the DLL with Visual C++: > > cl /c mylib.cc > link /dll /machine:x64 /export:exception_thrower /out:libmylib.dll mylib.obj > > Then compile the executable with MinGW: > > x86_64-w64-mingw32-g++ -g -O2 -Wall -I. crashtest.cc -o crashtest.exe -L. > -lmylib > > Finally copy libgcc_s_sjlj-1.dll and libstdc++-6.dll in the current directory. > > The resulting executable crashes with a stack overflow, instead of > displaying the expected message. > > Note that if you compile the DLL with MinGW-w64, everything works fine. > > Sorry if this is a known issue. > > Best regards, >
Hi, you cannot throw exceptions between different C++ compilers due to difference in ABI and implementation. The C++ standard is deliberately vague on ABI. This is a known issue, but not a bug. ------------------------------------------------------------------------------ Start uncovering the many advantages of virtual appliances and start using them to simplify application deployment and accelerate your shift to cloud computing http://p.sf.net/sfu/novell-sfdev2dev _______________________________________________ Mingw-w64-public mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
