News:

As usual while waiting for the next release - don't forget to check the nightly builds in the forum.

Main Menu

Problem with Exceptions Handling (newbie)

Started by HealingAura, November 28, 2006, 11:36:05 PM

Previous topic - Next topic

HealingAura

Hello,
I am trying to use Exceptions Handling in my C++ program but instead I keep getting this:

"This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information."

Instead of getting the right error text printed, this text above shows up and the program quits.

Did I forgot to enable something? Something tells me it's not supposed to happen  :?

sethjackson

#1
It should work (if your code is right), and you haven't passed -fno-exceptions to GCC (assuming GCC).
C++ exception handling works fine for me. BTW this isn't a programming forum. ;)

HealingAura

I use GCC compiler but I don't see this -fno-exceptions. Any idea why I get this message?

The code looks like this:

int FunctionName()
{....
     switch (num)
     { ..... default: throw "invalid number"; }
... }

int main()
{ ...
   try { ... FunctionName(); ... }
   catch(char *msg) { cout<<msg<<endl; }
... }

Pecan




Pecan

Quote from: HealingAura on November 29, 2006, 02:10:22 AM
Am I in the wrong forum?  :oops:
Sorry about that.
Programming questions on this forum should be related to the *use* of CodeBlocks. Not general questions concerning programming.