0

I am trying to use try-catch blocks to handle a divide-by-zero exception in marmalade, but I guess marmalade overrides c++ exception handling, so it's not working. I've searched on the forums and the solution seems to be that I have to add one option in the mkb as explained in this post.

options
{
    enable-exceptions=1
}

I already tried adding it, but it's not working too. Is there any way I can handle this exception?

0xC0DED00D
  • 19,522
  • 20
  • 117
  • 184
  • That's not valid C++. I have no idea what you're trying to do. C++ has no divide by zero exception. – Edward Strange May 24 '12 at 06:46
  • @CrazyEddie: it seems that marmalade is a specific framework, and this is the configuration file. – Matthieu M. May 24 '12 at 06:49
  • @CrazyEddie I am currently getting this exception - Unhandled exception at 0x02435baf (XXX.s86) in s3e_simulator_debug.exe: 0xC0000094: Integer division by zero. I didn't know that c++ don't have this exception. – 0xC0DED00D May 24 '12 at 06:51
  • 3
    @Creator - That is not a C++ exception but a (simulated?) hardware exception. – Bo Persson May 24 '12 at 06:53

1 Answers1

1

If you are writing an extension for the marmalade exceptions will not work. What the

options
{
    enable-exceptions=1
}

does is adds a compiler options /GX for msvc and --exceptions for RVCT. So if you are using some other compiler like g++ it will not work.