gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

C/C++ > exceptions under gba??

#13654 - Dragonlord - Fri Dec 19, 2003 11:52 pm

i wanna put up some OOP code for a lil project i'm in.
unfortunatly my effort was already killed at the most vital thing: exceptions.
compiling a code with a throw statement in it yielded this at link time:
Code:
>arm-agb-elf-gcc.exe -o _b
uild_\magdemo1.elf _build_\*.o -fexceptions -Wall
_build_\gbaSprite.o: In function `gbaSprite::gbaSprite(void*, int)':
_build_\gbaSprite.o(.text+0x3c): undefined reference to `__cxa_allocate_exceptio
n'
_build_\gbaSprite.o(.text+0x50): undefined reference to `__cxa_throw'
_build_\gbaSprite.o(.text+0x54): undefined reference to `typeinfo for int'
_build_\gbaSprite.o: In function `gbaSprite::gbaSprite(void*, int)':
_build_\gbaSprite.o(.text+0x94): undefined reference to `__cxa_allocate_exceptio
n'
_build_\gbaSprite.o(.text+0xa8): undefined reference to `__cxa_throw'
_build_\gbaSprite.o(.text+0xac): undefined reference to `typeinfo for int'
_build_\gbaSprite.o: In function `gbaSprite::gbaSprite(void*, int, int, int)':
_build_\gbaSprite.o(.text+0xec): undefined reference to `__cxa_allocate_exceptio
n'
_build_\gbaSprite.o(.text+0x100): undefined reference to `__cxa_throw'
_build_\gbaSprite.o(.text+0x104): undefined reference to `typeinfo for int'
_build_\gbaSprite.o: In function `gbaSprite::gbaSprite(void*, int, int, int)':
_build_\gbaSprite.o(.text+0x144): undefined reference to `__cxa_allocate_excepti
on'
_build_\gbaSprite.o(.text+0x158): undefined reference to `__cxa_throw'
_build_\gbaSprite.o(.text+0x15c): undefined reference to `typeinfo for int'
collect2: ld returned 1 exit status


is this a problem with that crt0 thingy? or why can't i compile code with exception in it.
_________________
Oh to be a dragon, of silkwork size or immense...

#13655 - sajiimori - Fri Dec 19, 2003 11:56 pm

Use g++ instead of gcc. G++ will automatically link in the appropriate objects for C++.

#13656 - Dragonlord - Sat Dec 20, 2003 12:00 am

thx... it worked
_________________
Oh to be a dragon, of silkwork size or immense...