I used CMake and Code::Blocks to build SDL2 from source, and attempted to link my own project source to the following static libraries:
libSDL2.a libSDL2main.a O
If you link with static SDL, you need to manually pull all libraries it uses:
imagehlp dinput8 dxguid dxerr8 user32 gdi32 winmm imm32 ole32 oleaut32 shell32 version uuid
Or just use dynamic SDL2.