www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/01/15/23:41:37

Date: Mon, 15 Jan 1996 22:31:24 -0600 (CST)
From: Aaron Ucko <UCKO AT VAX1 DOT ROCKHURST DOT EDU>
Subject: Re: Do exceptions work for gcc 2.7.2 on DOS?
To: max AT alcyone DOT com
Cc: djgpp AT delorie DOT com
Message-id: <01I0208SV7YA0015XJ@VAX1.ROCKHURST.EDU>
Organization: Rockhurst College; Kansas City, MO
MIME-version: 1.0

>> The symptoms: I've compiled GCC 2.7.2 and libg++-2.7.1 (hopefully
>> correctly - that remains to be seen). Simple hello, world programs seem
>> to work in C and C++, but I admit to not trying any more complex
>> programs. I've written a small program which basically throws an
>> exceptions and outputs messages to trace the flow of code. I compile with
>> the -fhandle-exceptions flag and attempt to link but get the following
>> errors:
>> 
>> In function 'main' - undefined reference to 'terminate(void)'
>> In function '__throw" undefined reference to 'terminate(void)'
>
>I get this same problem (I'm trying to use exceptions under gcc too, don't you
>know) for Linux with gcc 2.7.2 and libg++ 2.7.1.  According to the READMEs, it's
>because Linux uses a libc which is incompatible with libg++ (at least that's how
>I read it).  Perhaps a similar thing occurs under DJGPP.

The libc/libg++ compatibility thing had to do with libg++ 2.7's version of
stdio being incompatible with the older version used in Linux libc 5.[01].x
(5.2.x uses the newer version.)  It has nothing to do with exception handling.
The problem is simply that GCC still does not fully support exception handling
(although at the rate things appear to be going [just judging by NEWS], I
would not be surprised if the next major version of GCC (2.8? 3.0?) were
fully ANSI C++ compliant and therefore handled exceptions properly.

-- Aaron Ucko (ucko AT vax1 DOT rockhurst DOT edu; finger for PGP public key) | httyp!
"That's right," he said. "We're philosophers. We think, therefore we am."
-- Terry Pratchett, _Small Gods_ | Geek Code 3.1 [for explanation, finger 
 hayden AT mankato DOT msus DOT edu]: GCS/M/S/C d- s: a18 C++(+++)>++++ UL++>++++ P++ 
 L++>+++++ E- W(-) N++(+) o+ K- w--- O M@ V-(--) PS++(+++) PE- Y(+) PGP(+) t(+)
 !5 X-- R(-) tv-@ b++(+++) DI+ !D-- G++(+++) e->+++++(*) h!>+ r-(--)>+++ y?

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019