I get "Undefined reference to WinMain@16"
Under Visual C++, you need to link with SDLmain.lib. Under the gcc build environments like Dev-C++ or Ultimate++ with mingw you need to link with the output of "sdl-config --libs", which is usually: -lmingw32 -lSDLmain -lSDL -mwindows
Note that the order of these linker options is important!
