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++ > DevKitARM support C++, or just C?

#29683 - Abscissa - Tue Nov 23, 2004 9:42 pm

Does DevKitARM *officially* support C++? Or even if unofficially, how comepletely does it support it? I noticed that I can declare a class and instantiate it statically, but as far as I can tell, I can't instatiate anything dynamically with 'new', as I get teh error "undefined reference to `operator new(unsigned long)'" from the linker. Are there other C++-specific things DevKitARM doesn't totally support?

#29727 - NoMis - Wed Nov 24, 2004 10:03 am

Compile/Link with arm-elf-g++ if you have a C++ application. new and delete should work then.

NoMis

#30284 - Krakken - Tue Nov 30, 2004 1:44 am

NoMis wrote:
Compile/Link with arm-elf-g++ if you have a C++ application. new and delete should work then.

NoMis


I'm having the same problem and I _do_ compile with arm-elf-g++

#30325 - dj-ceejay - Tue Nov 30, 2004 9:18 am

Should it not be arm-agb-elf-g++ ?
Do you need to link newlib?
_________________
Fruit Machine Games:
http://www.fmsoftware.info/

#30330 - NoMis - Tue Nov 30, 2004 11:10 am

Krakken wrote:
I'm having the same problem and I _do_ compile with arm-elf-g++


It's a bit long since I last did something in gba development. But as far as I remember compiling with arm-elf-g++ worked.
I'll check that out when I'm at home.

dj-ceejay wrote:

Should it not be arm-agb-elf-g++ ?


I'm pretty sure it was arm-elf-g++

dj-ceejay wrote:

Do you need to link newlib?


Maybe, but I always thought that compiling with g++ does this automatic. Thats why I compile my C++ aplications with g++ instead of gcc


NoMis

#30338 - tepples - Tue Nov 30, 2004 5:47 pm

arm-agb-elf-g++ was DevKit Advance, which hasn't been updated in a long time.

arm-elf-g++ is devkitARM, which is still considered maintained.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#30341 - NoMis - Tue Nov 30, 2004 6:02 pm

I tried it now and it works fine. Make sure to use arm-elf-g++ for linking to.

NoMis

#30404 - Abscissa - Tue Nov 30, 2004 11:31 pm

I just got that working too.

BTW, I noticed that in my test program, using g++ added 46kbyte to the ROM size. Does anyone know if this is constant for any DevKitARM project going from gcc to g++, or can this size increase vary from project to project?

#30412 - Krakken - Wed Dec 01, 2004 1:07 am

NoMis wrote:
I tried it now and it works fine. Make sure to use arm-elf-g++ for linking to.

NoMis


Ah that'll be it. Cheers.