GP32 Undefined reference to GpMain


Eddie Catflap

Still Fresh
Joined
Sep 17, 2003
Messages
4
I use VC++.NET to edit my cpp files and then I run "make" from the command prompt.
My problem is that I get the message "in function GpKernelInitialise, undefined reference to GpMain" when I run make.

It is only a single simple .cpp file test program (with the correct includes, etc)and I am using a standard makefile (only changes are gpmain.o, gpmain.cpp changed to andymain.o gpmain.cpp, etc.)

I am using the devkitadv package, I Installed it as explained in the readme. Should I be using Parkitadv, or is there something fundamentally wrong with the way I am going about GP32 development? :unsure:

Many thanks in advance
Andy
 
compiling with arm-elf-gcc or arm-elf-g++?
I noticed a similar problem when i compiled with gcc instead of g++ (for cpp)

---
mithris
 
Hi mithris,

Not too sure, just using whatever Devkitadv uses by default.
I think my problem is that I am following the Gamepark official SDK guide to learn with, and am using functions that are probably different to their Devkitadv counterparts.
 
If youve got the official SDK, use that. unless youre planning on entering the compo ...

make sure you have GpMain declared before GpKernelInitialise.
 
Hi Delsabre,
What I mean is, I have got the SDK "guide" (from Gamepark, downloaded from this site somewhere (Dev->misc->documentation maybe)), but am following their examples using Devkitadv. I just wondered if there were any differences between the official SDK and Devkitadv that might have been causing the problem, ie: are the functions named differently.

What do you guys have defined in your gpmain.h file? Is it necessary to have one?

Thanks,
Andy
 
Default configuration for "make" with DevKitAdv has it only compiling one object per rule.

gpmain.o rule will only compile gpmain.cpp or gpmain.c

Try either renaming your main file to andymain.cpp or renaming the object file to gpmain.o and you should be fine.
 
Hi ,

I changed this and I also noticed that I had left out the "void *arg" from the GpMain argument list and had left it blank.
It now works fine, though if anyone can tell me why this argument is needed with GpMain, I would be very grateful, I'm guessing that it's passed from the GP32 initialisation code? :huh:

Thanks for all your help guys
Andy
 
It depends on the compiler. On x86 platforms, some gcc compilers will gripe if you don't use int main (int argc, char** argv). It really shouldn't matter unless you use the void pointer, and I don't know where you could honestly. The only thing I can think of is the void pointer is the GP32's ID sent to run encrypted programs, but I'm not sure.
 
Back
Top