[Question] ctrulib and C++ Exceptions?

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

  1. Lizalfos

    Lizalfos Newbie

    Mar 26, 2015
    Gambia, The
    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
    CXXFLAGS    := $(CFLAGS) -fno-rtti -fno-exceptions -std=gnu++11
    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:
    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

    GBAtemp Patron
    filfat is a Patron of GBAtemp and is helping us stay independent!

    Our Patreon
    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 :/
  3. Steveice10

    Steveice10 GBAtemp Maniac

    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

    Nov 28, 2014
    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?
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice