I installed SDL2 for mingw using this guide. However, when i try to compile using the compilation syntax and test code they provide, only with my own file names, I get the error
One way to let MinGW know where your SDL libraries are would be to create environment variable named "LIBRARY_PATH" with the value as the path to the directory containing the libraries. Similarly, you can have "CPLUS_INCLUDE_PATH" for the headers as well.
Did you follow step 2 of that tutorial ?