How to correctly handle exceptions?

Discussion in '3DS - Homebrew Development and Emulators' started by VegaRoXas, Sep 9, 2015.

  1. VegaRoXas
    OP

    VegaRoXas GBAtemp Regular

    Member
    290
    158
    Mar 29, 2015
    Gambia, The
    So I want to handle exceptions, for example an std:out_of_range exception. But how do I do this? I am already using try & catch.
    Warning: Spoilers inside!
    This happens when I run make. Where do I add the -fexceptions?
     
  2. TheCruel

    TheCruel Developer

    Banned
    1,351
    2,886
    Dec 6, 2013
    United States
    The 3ds (and even all embedded systems) commonly have exceptions disabled. Search your makefile for the "-fno-exceptions" flag and remove it if you want.
     
  3. VegaRoXas
    OP

    VegaRoXas GBAtemp Regular

    Member
    290
    158
    Mar 29, 2015
    Gambia, The
    I removed the flag but my 3ds is still freezing when the exception is being throwed. I try and catched everything where the exception could occur. Any help? :3
    It says "terminate called after throwing an instance of 'std::out_of_range' \n terminate called recursively"
     
  4. VegaRoXas
    OP

    VegaRoXas GBAtemp Regular

    Member
    290
    158
    Mar 29, 2015
    Gambia, The
    No one knows how? :c