Codeblocks, Straight C, No Errors - Wtf


TheMinder

Member
Joined
Mar 21, 2006
Messages
150
First of all i apologise for this thread.

I'm at the point where it is going to take either fresh eyes or 48 hours of sleep to sort out what is probably a real glaring NOOB error.

Background first :

I've setup CobeBlocks so it will compile the GuyFawkes example, and it works on the 2x as a gpe

I've written something in C (not C++ and i include this just to get as much info as i can across) using SDL that compiles fine for windows (using dev c++) and so (as was the aim) i thought i'd switch it over to CodeBlocks, follow the same procedure as for the GuyFawkes and would have a working gpe

Noticed 2 things when compiling :
1) no errors on BUILD, not even the one you sorta expect and get with the example prog
2) the gpe that gets made is only 927K which is a third the size of the example one

and further to that the gpe just black screens on the 2x

Is there something real obvious, real noob, real tiredness can't see the wood for the trees that i'm missing ?

is it cos it's C ? is something not linking correctly ? and so on

any ideas will be welcomed
 
You should probably check the program's error output (use sterm or mocca (plug :p)).

My first guess: the SDL libs are not compiled in. Do you have them installed on your gp2x?
 
Depends on how many libraries you are linking/using. Guyfawkes used most if not all the SDL libraries available at the time.
 
gp2x has sdl on it setup and working, the thing ive done only needs sdl.h

thanks for the replies - i'll have a look at what those plugins are all about
 
after searching around the subject i've been introduced to the joys of debugging using usb serial and TeraTermPro

seems like this isn't being liked right at the start :

void init_gfx(void) //get bmp in (mostly)
{
printf("made it to start of init gfx");
border = SDL_LoadBMP("images/borderW.bmp");
dead = SDL_LoadBMP("images/dead.bmp");
live = SDL_LoadBMP("images/live.bmp");
cursor = SDL_LoadBMP("images/cursor.bmp");
splash= SDL_LoadBMP("images/splash.bmp");
SDL_SetColorKey(cursor, SDL_SRCCOLORKEY, SDL_MapRGB(cursor->format,255,0,255));
printf("about to exit init gfx");
return;
}

cos even commenting out the belly of that the seconf printf doesn't seem to come up

still at least i can see it now thanks to the wonders of the usb cable
 
TheMinder posted on Apr 10 2006 at 02:15 PM said:
after searching around the subject i've been introduced to the joys of debugging using usb serial and TeraTermPro

seems like this isn't being liked right at the start :

(snip)

still at least i can see it now thanks to the wonders of the usb cable
You can use gdb on the gp2x too to aid debugging.

Get it here:
http://www.gp2x.de/cgi-bin/cfiles.cgi?0,0,0,0,14,1114
 
Last edited by a moderator:
thanks for all the input - i really don't get why things weren't working still but it works now so that's something

i altered the code above so that instead of having a function to init all the gfx i just did them where they were needed
 
I can't be sure that this is your problem, but

// this is a C++ comment,

/* this is a straight C comment */

Maybe you were confusing the compiler?

edit: oh, and your function definition should probably have been:
void init_gfx()

No need for the second void.
 
because of the code that worked i can say it wasn't either of those but both good ideas i had overlooked so ta

really don't know if i had done something totally stupid etc

i'll be posting the working source in the thread here very soon

[EDIT]added the source and put the file in the archive here [/EDIT]
 
Last edited by a moderator:
Back
Top