[odb-users] ODB exception problem

cetoni GmbH - Uwe Kindler uwe.kindler at cetoni.de
Wed Jun 15 04:59:24 EDT 2011


Hi Boris,

the strange thing is, that it is not sufficient to change libodb build 
to use -shared-libgcc -shared-libstdc++ options but that I need to add 
these linker options to all our DLL projects explicitely to make it work 
properly.

 From reading the README file that comes with MinGW GCC4.5.1 it seems, 
that the linker links to the static libaries (libgcc and libstdc++) by 
default and that a shared memory region ensures that throwing exceptions 
across DLL boundaries is possible even when using the static versions.

Here the snippet from the README file:

--------------->
...
However, TDM-GCC also continues to integrate a versioned shared memory 
region
for the *static* (non-DLL) runtime libraries, which will still allow you to
throw exceptions between any DLLs or executables that are built with 
TDM-GCC.
This method incurs a very small execution overhead as compared to the shared
library method, but has the very important benefit of not requiring you to
redistribute extra DLLs with your program.

By default, TDM-GCC will continue to create executables and DLLs that 
use the
static libraries and do not require you to redistribute further DLLs.
...
<-----------------

And this specific mechanism seems to fail for libodb library. So the 
only solution to use exceptions and libodb is to add the linker options 
-shared-libgcc -shared-libstdc++ to all libodb and any other DLLs - 
thats what I did.

Kind regards, Uwe






-- 
Mit freundlichen Grüßen

Uwe Kindler
Dipl. Inf. (FH)
Software Engineering

cetoni GmbH
Automatisierung und Mikrosysteme
Am Wiesenring 6
D-07554 Korbussen

Phone: +49 (0) 36602 338 28
Fax:   +49 (0) 36602 338 11
Email: uwe.kindler at cetoni.de
Web:   http://www.cetoni.de

Handelsregister Jena   HRB 202566
Ust.-Ident-Nr.         DE 1505 26212

Geschäftsführer:
Tilo Kunze



More information about the odb-users mailing list