From: Charles W. <cwi...@us...> - 2011-01-27 22:05:15
|
On 1/27/2011 4:44 PM, Jack Ambler wrote: > On windows g++ -v gives this: > --disable-sjlj-exceptions --with-dwarf2 --enable-shared --enable-libgomp ^^^^^^^^^^^^^^^ > On linux, g++ -v gives this: > --with-gcc --with-gnu-ld --with-gnu-as --disable-nls --disable-shared ^^^^^^^^^^^^^^^^ IIRC at present, in order to throw exceptions across the DLL boundary, you must link against a shared version of libgcc/libstdc++ (*). Since your cross compiler is not configured to even HAVE shared versions of those runtimes, that compiler always generates executables that link against the static runtime libs. Try rebuilding your cross compiler with support for shared runtimes. (*) At least, with stock gcc. TDM's builds have a forward port of the (ugly, horrid, ABI-breaking) 3.4.5 patch that allowed to throw exceptions across DLL boundaries even when linking to the static runtimes. This ugliness was *necessary* in 3.4.5, because we could not at the time build the runtimes as shared libs -- but everybody, including the author of that patch, said that The Right Thing To Do was to build the runtimes as DLLs. Now that 4.x CAN do that, the horrid patch was dropped since it is no longer *necessary* -- with the effects you see: if you link with static runtimes, you can't throw exc across dll boundary. But...you can use the DLL runtimes instead... -- Chuck |