Pleaserefertothefollowingsites:

#https://users.cs.jmu.edu/bernstdh/web/common/help/cpp_mingw-sdl-setup.php

Tutorial:
#http://lazyfoo.net/SDL_tutorials/index.php

Additionallibraries:
#http://www.libsdl.org/projects(foradditionallibraries,e.g.SDL_p_w_picpath)

Note:1.howtocompile,linkandrunthetest.c,refertoMakefile.

2.theorderoflinkinglibrariescannotbechanged!

Makefile:

all:
gcc-g-oYourFile.exeYourFile.c-lmingw32-lSDL2main-lSDL2-lSDL2_p_w_picpath