GP32 GPSDK+libC not work


chui

Certified Guru
Joined
Jul 15, 2003
Messages
78
Hi all!

My linux compiler: GP32 Cross Toolchain for debian users.
Not work (gp32 exception!) GPSDK+libC. Probe this gpmain.c with
gpstart.c:
---------
#include<stdio.h>
#include<stdlib.h>

void GpMain(void *arg)
{
int i;
void *mem;
for(i=0;i<10;i++)
mem=malloc(1024*64);
while(1);
}
---------
Anybody works it? Any idea?

Ciao!
 
I use the same debian toolchain and it appears to work for me.

I have had loads of problems with malloc in the past though. Try using gp_mem_func.malloc instead.
 
Hmmm, looks like I was wrong before. Now I run it again I do get the crash (I was very low on batteries earlier, maybe it needs less power to work :huh:)

Changing to gp_mem_func.malloc (or gm_malloc) does fix the problem though. You could either change all mallocs, or try and redefine malloc in some way (which I think is what you'll probably want to do 'cos I guess you're trying to get SDL apps porting easily)
 
Not so easy. ie:stdio functions (fopen, fread...) not compatible with gp-stdio.

Port ALL libSDL with GPSDK functions is a lot of work time.
 
The toolchain is compiled for debian unstable so it wont work unless u got that.
 
Back
Top