catching Exceptions thrown from within a DLL (egcs,NT,C++,b20.1)

Paul Henshaw
Fri Aug 20 09:43:00 GMT 1999

Dear All,

	having managed now to build and link against a DLL, I have
	encountered a problem with exception handling.

	I have a test program which deliberately provokes an exception,
	expecting to catch it, and throw it to it's caller.

	When I run the DLLed version of this program, the exception
	is constructed and displayed correctly, but the caller does
	not catch the exception, and my SIGABORT handler is called.

	The same program linked statically behaves as expected.

	So is there is some magic incantation to chant over DLLs
	to make exceptions work, or am I just being stupid (again)?

	The programs and libraries are built with egcs-1.1.2 on
	Windows NT workstation with cygwin-b20.1.  

	Rather than use the __declspec(dllexport/import) syntax all
	over, I have hidden all my global/class static data behind
	access functions - this seems cleaner as it does not 
	introduce "magic words" in the source, and is probably a 
	more sensible and flexible approach anyways.  On the other
	hand it might have something to do with the problems I have
	Once again, any help or advice is very much appreciated.

Paul Henshaw, Institute for Systems, Informatics and Safety 
TP270,  JRC Ispra,  21020 Ispra (VA),  Italy
Tel:    ++39 0332 785262        Fax: ++39 0332 789185

Want to unsubscribe from this list?
Send a message to

More information about the Cygwin mailing list