I have been using sdl 1.2 for the past several months(On windows).I am thinking about migrating to 1.3. So I used cmake and codeblocks to create the static and dynamic libray.no
I also was searching for an answer to this and, as I couldn't find one, here's what worked for me:
If using mingw as compiler, you have to link to the follow libraries in this order:
-lmingw32 -lSDL2main -lSDL2 -lm -ldinput8 -ldxguid -ldxerr8 -luser32 -lgdi32 -lwinmm -limm32 -lole32 -loleaut32 -lshell32 -lversion -luuid