I don’t know about the rest of your problem, but from what I remember
linking
with SDLmain provides a main function that wraps around a main function you
supply (called SDL_main). If you supply your own main function it’s my
belief
that you shouldn’t link with SDLmain, only SDL.
Just for information: that doesn’t work.
Thanks for your answer anyway
(For correct error bugging see answer from Johannes Schmidt.)
Gerhard