Homebrew [Question] ctrulib and C++ Exceptions?

  • Thread starter Thread starter Lizalfos
  • Start date Start date
  • Views Views 1,655
  • Replies Replies 3

Lizalfos

New Member
Newbie
Joined
Mar 26, 2015
Messages
1
Reaction score
14
Trophies
0
XP
135
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?
 
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
 
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.
 
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?
 

Site & Scene News

Popular threads in this forum