From: pavenis AT lanet DOT lv Message-ID: To: Eduardo M Kalinowski , djgpp AT delorie DOT com Date: Tue, 21 Sep 1999 21:36:40 +0300 MIME-Version: 1.0 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7BIT Subject: Re: C++ Exception Support In-reply-to: <7s7mbf$2s7$1@nnrp1.deja.com> X-mailer: Pegasus Mail for Win32 (v3.12a) Reply-To: djgpp AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk On 21 Sep 99, at 10:23, Eduardo M Kalinowski wrote: > In article <7s0l5p$fpc$1 AT solomon DOT cs DOT rose-hulman DOT edu>, > "Damian Yerrick" wrote: > > > > I was trying to run a C++ program compiled that uses exceptions, but > > I didn't post the source code. > > > > The custom here on comp.os.msdos.djgpp and most other > > programming newsgroups is to post the smallest code fragment > > that produces the error. Post your source and we'll fix it. Don't > > post your source and we won't fix it because we're not psychic > > and we can't see the problem. > > I didn't post the source because I was describing a problem not > relevant to that specific code, but a general failure. Anyway, here is > the smallest fragment that will trigger the error: > > ---start--- > #include > > int > main() > { > try { > throw "Test"; > } catch (char *e) { > cout << "Exception caught: " << e; > } > > return 0; > } > ---end--- You are throwing const char * but trying to catch char * Try catching const char: catch (const char * e) { cout << "Catched\n"; } At least worked for me. Andris