[SDL] seg fault despite Extern screen
peter.cutting at gmail.com
Tue Feb 19 05:55:36 PST 2008
I found the bug. The demo declared screen twice. Once statically and once in
main(). So the one in main was initialised but the static one (used by the
filebrowser code) was not.
On Feb 19, 2008 2:09 PM, Peter Cutting <peter.cutting at gmail.com> wrote:
> 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
> How can this be?
> Peter Cutting
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the SDL