Hello, I am tyring to comile a project with SDL2 through command line with MinGw. I have a run.bat file that looks like so:
g++ -o Game.exe Main/Main.cpp -lmingw32 -lSDL2main -mwindows -lSDL2
pause
start /d "C:\Users\Mathew Bergen\Documents\Programming\C++\LD Practice" Game.exe
I get these errors:
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/lib/libmingw32.a(main.
o): In function `main':
e:\p\giaw\src\pkg\mingwrt-4.0.3-1-mingw32-src\bld/../mingwrt-4.0.3-1-mingw32-src
/src/libcrt/crt/main.c:91: undefined reference to `WinMain@16'
collect2.exe: error: ld returned 1 exit status
I googled the WInMain@16 error and I found that I needed to add -mwindows to the linking command, but it still does not work. I am on windows 7, Thanks for any help.