I tried using this on Windows with MSYS2, but after updating the paths in the makefile I still got an undefined reference to `WinMain' error. For anyone else potentially facing this problem:
To avoid this error you have to change the type of main from int main() to int main(int argc, char **argv) and put -lmingw32 -lSDL2main before -lSDL2.
(You can instead also put #define SDL_MAIN_HANDLED somewhere before #include <SDL2/SDL.h> in main.cas this bypasses SDL2's special handling of main, but I'm unsure of whether this could lead to other problems)
I tried using this on Windows with MSYS2, but after updating the paths in the makefile I still got an
undefined reference to `WinMain'error. For anyone else potentially facing this problem:To avoid this error you have to change the type of main from
int main()toint main(int argc, char **argv)and put-lmingw32 -lSDL2mainbefore-lSDL2.(You can instead also put
#define SDL_MAIN_HANDLEDsomewhere before#include <SDL2/SDL.h>inmain.cas this bypasses SDL2's special handling ofmain, but I'm unsure of whether this could lead to other problems)