GP32 C++ and devkitadv


nigelibrown

Member
Joined
Jan 7, 2004
Messages
149
Age
53
Location
Bristol, England
Website
www.nigelibrown.pwp.blueyonder.co.uk
I am compiling under devkitadv, and have a few questions.

How do you use c++ instead of c? Have tried to edit gp32.mk from 'gcc' to 'g++' but then it is unable to locate the GpLibrary routines?

How can I upgrade the compiler part of this installation to a newer version the current won't understand all of the documented asm stuff. :blink:
 
Have found very usefull source and information on http://www.brianpostma.com/gp32.html nice website full of relevant info.

Can now compile a c++ prog using Brians makefile as an example.

Now get a problem with gpgraphic16 stuff not being seen? Anyone have any ideas?

video.o(.text+0x70): undefined reference to `GpRectFill16(tagGPDRAWTAG*, tagGPDRAWSURFACE*, int, int, int, int, int)'

The include file is where it should be in:
devkitadv/arm-agb-elf/include/gp32/gpgraphic16.h

And the library is in:
devkitadv/arm-agb-elf/lib/libgpgraphic16.a

gp32.mk has been edited to include the library
GPLIBS=-lgpgraphic16 ...

CPPFLAGS and CFLAGS hava had: added
-L$(CCBASE)/arm-agb-elf/lib

The result from 'nm libgpgraphic' returns GpRectFill16 as a valid entry:

I must be overlooking something? I wonder if the version of the 16bit graphics stuff is compatible with the version of the devkitadv I am using? Where can I find some more recent version? Do people really onlly use 8bpp graphics? WHY! WHY! WHY!
PLEASE HELP!!!!
 
Sorry this is a bit late, didn't see your post till now.

I haven't been trying this myself, but it sounds like you have a name mangling problem. In C++, function names are mangled to include the parameter types (this is how function overloading works).

You will need to declare your functions like this

extern "C" void function();

Or you can mark an entire section:

extern "C" {
... rest of header file here
}

And that should tell the c++ compiler not to mangle the names.

Hope this helps!
 
Back
Top