This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: exception thrown in shared library not caught?


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]