This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: exception thrown in shared library not caught?
- To: gcc at gcc dot gnu dot org
- Subject: Re: exception thrown in shared library not caught?
- From: "Brian J. Murrell" <6c7946666aaf6d1d54809adb1f06522c at interlinx dot bc dot ca>
- Date: Fri, 15 Oct 1999 12:06:51 -0700 (PDT)
I wrote:
>
> The problem I am having is that I build a shared library and then link
> an executable against it. However if a method in the shared library
> throws an exception, the executable linked against it does not catch
> it,
> despite it's use of try/catch blocks for the specified exception
> class.
> The executable ends up abort()ing, as if there was no try/catch at
> all.
The answer to this comes from a usenet posting from our friend Casper
H.S. Dik:
http://x38.deja.com/getdoc.xp?AN=437466897&search=thread&CONTEXT=940013823.1895956597&HIT_CONTEXT=940010454.1812529343&HIT_NUM=7&hitnum=1
Which explains that you must use "g++ -shared" to link your executables,
not "ld" as I was doing. Nasty nasty.
b.
--
Brian J. Murrell InterLinx Support Services, Inc.
North Vancouver, B.C. 604 983 UNIX
Platform and Brand Independent UNIX Support - R3.2 - R4 - BSD