Can't install SDL on MinGW, getting `undefined reference to WinMain@16`
问题 I'm trying to install SDL on MinGW. I've downloaded SDL from here (the SDL2-devel-2.0.0-mingw.tar.gz link), then copied the contents of SDL2-2.0.0/x86_64-w64-mingw32/{bin,include,lib} into the matching directories in my MinGW installation. When I try to compile any file that contains #include ‹SDL2/SDL.h› using gcc test.c -lmingw32 -lSDL2main -lSDL2 -mwindows , GCC complains about undefined reference to WinMain@16 and undefined reference to some SDL functions. 回答1: SDL2-devel-2.0.0-mingw.tar