Homebrew [Question] ctrulib and C++ Exceptions?

Lizalfos

New Member
OP
Newbie
Joined
Mar 26, 2015
Messages
1
Trophies
0
XP
105
Country
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?
 

filfat

Musician, Developer & Entrepreneur
Member
Joined
Nov 24, 2012
Messages
1,259
Trophies
0
Location
Göteborg
Website
spsgroup.se
XP
1,718
Country
Sweden
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?

libctru currently doesn't support Tray and Catch (eg exception handling ) which makes it a pain in the ass to develop for :/
#FeelYourPain
 
D

Deleted User

Guest
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.
 

capz

Well-Known Member
Newcomer
Joined
Nov 28, 2014
Messages
74
Trophies
0
Location
cake town
XP
102
Country
Netherlands
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?
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • K3N1 @ K3N1:
    Average Florida night
  • Psionic Roshambo @ Psionic Roshambo:
    Fresh Princess of Bellaire, I wonder if they could get Will Smith to cross dress and slap people....
  • K3N1 @ K3N1:
    He only slaps other celebrities that are liked better than him/her
  • Psionic Roshambo @ Psionic Roshambo:
    "Chris your not woke!!!" *Slap* lol
  • K3N1 @ K3N1:
    Maybe the slap woke him
  • K3N1 @ K3N1:
    He doesn't like to fight in front of white people though
  • Psionic Roshambo @ Psionic Roshambo:
    Could be, maybe Chris is into S&M now lol
  • Psionic Roshambo @ Psionic Roshambo:
    Slapping and clapping booties
  • K3N1 @ K3N1:
    His new girlfriends name is probably Samantha the blond hair girl
  • Psionic Roshambo @ Psionic Roshambo:
    Sam was his male name lol
  • K3N1 @ K3N1:
    It's a normal transition
  • Psionic Roshambo @ Psionic Roshambo:
    Pre op though so there is that lol
  • Psionic Roshambo @ Psionic Roshambo:
    I'll defined gender lines is comedy gold 🥰 not sure laughing about it... Does that make me insensitive or just accepting and it's funny that people get angry about trans stuff? Lol
  • K3N1 @ K3N1:
    No you just want to be cancelled by people in diapers
  • K3N1 @ K3N1:
    It depends
  • Psionic Roshambo @ Psionic Roshambo:
    Lol if they are 30 and in diapers I'm good with that lll
  • K3N1 @ K3N1:
    Some in their 60s @AncientBoi is probably in your closet
  • Psionic Roshambo @ Psionic Roshambo:
    I'm pretty sure he isn't in the closet lol
  • K3N1 @ K3N1:
    He's not in his closet just in yours
  • K3N1 @ K3N1:
    I support M/M walk in closets
  • Psionic Roshambo @ Psionic Roshambo:
    Hmm mom Tom Cruise is in the closet!!!
  • K3N1 @ K3N1:
    It always feels like shit series are the ones you watch the most
  • K3N1 @ K3N1:
    Like idk why I'm watching it but I keep wanting to
    K3N1 @ K3N1: Like idk why I'm watching it but I keep wanting to