I'm not getting MinGW's g++ to successfully compile SDL programs. Here's my sample program:
#include <SDL.h>
int main( int argc, char* args[] )
{
SDL_Init( SDL_INIT_VIDEO );
SDL_Quit();
return 0;
}
and here's my command and error report:
C:\Users\briggs_w\Desktop\testSDL>g++ test.cc -IC:\MinGW\include\SDL
-LC:\MinGW\lib -lSDL2 -lSDL2main -lmingw32
C:\MinGW\lib/libmingw32.a(main.o):(.text.startup+0xa0): undefined reference to `WinMain@16'
collect2.exe: error: ld returned 1 exit status
I copied over everything in SDL2's lib\x64
and i686-w64-mingw32\lib
folders to the C:\MinGW\lib
folder.
What's missing? At the command line, maybe.
I did look over two threads on similar errors:
Undefined reference to WinMain@16 when using SDL -- doing this
undefined reference to WinMain@16 C++, SDL-2 -- no effect