Homebrew [Question] ctrulib and C++ Exceptions?

Lizalfos

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

CTO @ Nordcom Group Inc.
Member
Joined
Nov 24, 2012
Messages
1,261
Trophies
1
Location
Gothenburg, Sweden
Website
www.sweetsideofsweden.com
XP
1,749
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
112
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?
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    Xdqwerty @ Xdqwerty: @salazarcosplay, no sabría cómo decirte