[SDL] Can't run SDL apps in OSX 10.6

Zoltán Kócsi zoltan at bendor.com.au
Sat Dec 11 04:52:14 PST 2010


My apologies if the stuff below sounds stupid or ignorant but

> ... snip ...
> /*
>  * Built with
>  * cc -g -ggdb3 -fno-inline -o test_sdl test_sdl.c
> -I/opt/local/include -L/opt/local/lib -lsdl -lsdlmain
>  */
> void run();
> 
> int main(int argc, char *argv[]) {
>     run();
> }
> 
> #include <SDL/SDL.h>
> 
> void run()
> {
>     SDL_Init(SDL_INIT_VIDEO);
>     SDL_SetVideoMode(640,480,0,SDL_OPENGL);
> }
> ... snip ...

main() enters, calls run() which initialises SDL then run() returns and
main() returns (without actually returning an exit code). The SDL event
loop never entered.

If some threads are started when SDL talks to OpenGL (don't know if that
happens or not) which would need to be synchronised by the event loop,
that might be an issue.

Also, does SDL return any error code from either calls? 
Do you know which one fails?

(Note that I have no idea what libsdlmain is, I only ever linked against
libsdl on Linux)

Regards,

Zoltan



More information about the SDL mailing list