I wrote a simple game (Pong) using C++ library SDL2 and tried to compile it for Windows (.exe) on Linux.
i have tried this to no avail:
x86_64-w64-mingw32-g++ -W -o test.exe test.cpp -lmingw32 -lSDL2 -lSDL2main -lopengl32 -lglu32 -mwindows
but switching the order of -lSDL2 -lSDL2main
works:
x86_64-w64-mingw32-g++ -W -o test.exe test.cpp -lmingw32 -lSDL2main -lSDL2 -lopengl32 -lglu32 -mwindows
What is happening here?