Quote Originally Posted by paul_nicholls
I have fixed my program.

Here are my SDL_getenv findings:

Call SDL_getenv but don't store the result - works
call SDL_getenv and store the result in either PChar or AnsiString - doesn't work (hangs the GP2X...)

Does this help?

cheers,
Paul.
I have the feeling that under GP2X the FPC version of getenv may be broken or that SDL should be using the C getenv and not the FPC fpgetenv. Could you try the following just to be sure where the commented code is...
[pascal]{$IFDEF UNIX}
{$IFDEF FPC}
{$IFDEF GP2X}
result := getenv(......);
{$ELSE}
result := fpcgetenv(......);
{$ENDIF}
{$ENDIF}
{$ENDIF}[/pascal]