GP2X Sdl On F200


gavinb2k

Still Fresh
Joined
Sep 29, 2007
Messages
40
Hi all,

i am succesfully compiling applications for gp2x using devkit2x and SDL lib from pearyn, when copying the gpe file accross to the f200 to run is there anything else that needs to be copied? its just if i run my apps or any of e the sample apps on the gp2x i just get a black screena nd it appears to lockup the f200, other things run like picodrive and cps2, its just stuff i compile with sdl sdk, there are no errors during compilation and the .gpe is completed ok? i cant think of anything else.

many thanks
 
Parkydr said:
Have you statically linked it, if not it won't find the dynamic libraries.

i hadn't with mine project to be honest. but looking that the makefile for the demo apps that came with SDK they are static linked (unless i'm mistaken??) but even the demo app gets a black screen and locks up
 
Last edited by a moderator:
Gavin said:
Parkydr said:
Have you statically linked it, if not it won't find the dynamic libraries.

i hadn't with mine project to be honest. but looking that the makefile for the demo apps that came with SDK they are static linked (unless i'm mistaken??) but even the demo app gets a black screen and locks up



REALLY stupid question, what do i need to add to make file to make it static linked? is it just add -static to the to the g++ switches?

ta
 
Last edited by a moderator:
Gavin said:
Parkydr said:
-static in the link flags

Legend.

thanks


lol....kk....this is doing my head in. i have made sure it's static in my project and the samples and it just goes to black screen and locks up?

can n e one take a look at my proj. file?

here
 
Last edited by a moderator:
You need to set up a script to run your program and redirect the output to a file so you can see what error messages (if any) there are.

Are you restarting the menu? If not that would explain the black screen and "lock up"

ps proj link is broken
 
Parkydr said:
You need to set up a script to run your program and redirect the output to a file so you can see what error messages (if any) there are.

Are you restarting the menu? If not that would explain the black screen and "lock up"

ps proj link is broken

sorry. had probs with fasthost so link off till they sort it :-(
upon exit from the app the it just calls the sdl quit function then returns 1? is this poss the issue, as i dont restart menus?
 
Last edited by a moderator:
Add the following after SDL_Quit():

CODE

chdir("/usr/gp2x");
execl("gp2xmenu", "gp2xmenu", NULL);
return 0;



(this will only get rid of the black screens that appear after your app quits)
 
Alex. said:
Add the following after SDL_Quit():

CODE

chdir("/usr/gp2x");
execl("gp2xmenu", "gp2xmenu", NULL);
return 0;
(this will only get rid of the black screens that appear after your app quits)



many thanks, i'll create a shell script to capture the ouptput from the file as well.
thanks for helping :)
 
Last edited by a moderator:
I think it's better to put

CODE

cd /usr/gp2x
exec gp2xmenu



at the end of your script, rather than in your program, then if the program crashes you can still get back to the menu without turning your GP2x off and on again.
 
thx, with ref. to capturing errors to a file would this work:

run.sh:::
CODE

#!/bin/bash
exec main.gpe > error.txt
cd /usr/gp2x
exec gp2xmenu
 
CODE


#!/bin/bash
./main.gpe > error.txt 2>&1

sync

cd /usr/gp2x
exec gp2xmenu




2>&1 to redirect stderr to stdout and so to the file too.

sync to force buffered data to be written to the SD card.

exec overwrites the current process so the script finishes when exec is called.
 
Parkydr said:
CODE


#!/bin/bash
./main.gpe > error.txt 2>&1

sync

cd /usr/gp2x
exec gp2xmenu

2>&1 to redirect stderr to stdout and so to the file too.

sync to force buffered data to be written to the SD card.

exec overwrites the current process so the script finishes when exec is called.


Legend, thanks alot, shall have a play when work is finially finished, see if i can see why its crashing out
 
Last edited by a moderator:
Gavin said:
Parkydr said:
CODE


#!/bin/bash
./main.gpe > error.txt 2>&1

sync

cd /usr/gp2x
exec gp2xmenu

2>&1 to redirect stderr to stdout and so to the file too.

sync to force buffered data to be written to the SD card.

exec overwrites the current process so the script finishes when exec is called.


Legend, thanks alot, shall have a play when work is finially finished, see if i can see why its crashing out


OK, i've tried the script which creates the error.txt file but added nothing to it, it executes the compiled file which just locks up again and doesnt resond, does n e 1 have just a VERY basic .cpp file and makefile i can compile and test?
 
Last edited by a moderator:
be warned, im going to jump on your throat and kill you if you say "n e 1" again.

I would suggest you to let someone else run your app through the terminal and monitor the output, which just isn't possible with the f200 afaik...
 
Vimacs said:
be warned, im going to jump on your throat and kill you if you say "n e 1" again.

I would suggest you to let someone else run your app through the terminal and monitor the output, which just isn't possible with the f200 afaik...



There's always the serial port.
 
Last edited by a moderator:
Vimacs said:
be warned, im going to jump on your throat and kill you if you say "n e 1" again.
Lol, i lazy type i'm afraid, its saves me seconds....
of course no more lazy than - afaik... :D

i think the app. is crashing at beginning, as even if i make the first line of the main function
CODE

#include <stdio.h>

int main(int argc,char **argv)
{
fprintf(stderr,"Program entry\n");
return 0;
}



this prints nothing out in the error text file and just this simple code is locking up :-(
 
Last edited by a moderator:
Back
Top