I have downloaded SDL2 (SDL2-devel-2.24.0-mingw.tar.gz) and followed the instructions here.
When I try to run the sample code I am getting "error: id returned 1 exit status". After looking through similar threads I assumed it was an issue of using the 32 bit libraries with a 64 bit compiler or vice versa. So I tried both 64 bit and 32 bit libraries and include files with both cygwin64 and mingw32 and am still getting the same error.