[SDL] seg fault despite Extern screen

Peter Cutting peter.cutting at gmail.com
Tue Feb 19 05:09:37 PST 2008


Hi
I have some C experience but am also a gcc/SDL/gp2x/CodeBlocks NOOB. I am
trying to setup a GP2X dev environment on windows. I found a ready to go
gp2x toolchain including CB and am able to build a simple SDL demo app for
windows (and gp2x). This runs OK

I am trying to mix in some SDL filebrowser code that I found. It
compiles/links but seg faults when the filebrowser code tries to access
fields in the screen pointer object.

The filebrowser code does a :-      extern SDL_Surface *screen;
(like it should)

so the screen pointer declared (statically) in the main file (and
initialised) should be accessible in the filebrowser code. But in the
debugger I see that the screen pointer is undefined while in the filebrowser
code.

How can this be?

Thanks
Peter Cutting
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20080219/34a7c955/attachment-0007.htm>


More information about the SDL mailing list