[Question] ctrulib and C++ Exceptions?

Discussion in '3DS - Homebrew Development and Emulators' started by Lizalfos, Mar 26, 2015.

  1. Lizalfos
    OP

    Lizalfos Newbie

    Newcomer
    1
    0
    Mar 26, 2015
    Gambia, The
    Hi,
    I'm working on a homebrew project written in C++
    At some point, the app crashes and on real hardware it's saying:
    "terminate called after throwing an instance of 'std::bad_alloc' terminate called recursively"
    So i tried to simply wrap a try-catch around some lines of code
    but i can't compile it anymore.

    I've changed
    Code:
    CXXFLAGS    := $(CFLAGS) -fno-rtti -fno-exceptions -std=gnu++11
    to
    Code:
    CXXFLAGS    := $(CFLAGS) -fno-rtti -std=gnu++11
    in my project makefile, and also for ctrulib and i've recomplied everything,
    but i still get the same error during linking:
    Code:
    linking template.elf
    11621045 relSymAddr=00CBBF2D relSrcAddr=001AB684 topAddr=001C0000
    Relocation to invalid address!
    Can anybody help me please?
     
  2. filfat

    filfat Musician, Developer & Entrepreneur

    Member
    1,231
    858
    Nov 24, 2012
    libctru currently doesn't support Tray and Catch (eg exception handling ) which makes it a pain in the ass to develop for :/
    #FeelYourPain
     
  3. Steveice10

    Steveice10 GBAtemp Maniac

    Member
    1,102
    1,658
    Jul 19, 2009
    United States
    I had the same issue before. Turned out there was an issue in 3dsxtool. Try compiling 3dsxtool from the latest source and replacing your copy of it in devkitARM with the new one.
     
  4. capz

    capz Advanced Member

    Newcomer
    70
    23
    Nov 28, 2014
    Netherlands
    cake town
    for the record, most console devkits traditionally do not support exceptions and try-catch due to the overhead that comes with it. While annoying, there certainly are ways to work around this kind of issue. Does anyone know if exceptions work on vanilla firmware with ninjhax?