Whenever I compile my code, I get the error undefined reference to 'SDL_main'
I have tried using #define SDL_MAIN_HANDLED
, before I include SDL related header files, I have tried using #define main SDL_main
, and I have tried using #include <SDL2/SDL_main.h>
. None of these have made a difference, and I get the same error when I try all three. I am not using a makefile and instead I am compiling the program from the terminal with g++ -I include -L lib -o randomgame randomgame.cpp -lmingw32 -lSDL2main -lSDL2 -lSDL2_ttf
.