For all of the users that get a cacophony of ‘undefined reference’ errors when starting to use SDL2 in an IDE: this will likely fix most/all problems.
Under Properties>C/C++ Build>Settings
Add '/usr/include/SDL2' to the Includes folders for the compilers
Make sure 'SDL2' is present in Libraries for the Linker
Under Properties>C/C++ General>Paths and Symbols
Add 'SDL2' to the Libraries Tab
What is off-putting is that even though SDL is a header-only library (not having any .so/.dll files): the IDE still wants you to add the names of the libraries in order to set everything up correctly, so it’s very counter-intuitive for non-programmers.
Although this may seem trivial to many, there aren’t any tutorials on setting up Eclipse for working with SDL and this might be a lifesaver for beginners looking to get into programming.
I also made and uploaded a quick YouTube video right after I found the solution.
https://www.youtube.com/watch?v=SXBaE6KHr_s