Are you linking to static or dynamic SDL2 link libraries (.lib or .dll)? SDL2's license permits static linking, unlike SDL1, so you are not required to distribute your application with .dll files; you can simply bake SDL2 as a static library into it.
Have you built SDL2 from source, or simply installed the runtime binaries? Typically, installing precompiled libraries/runtime binaries is a headache. I recommend you manually compile the SDL2 library. There are several ways to do this and one of them is to import one of the SDL2 solutions/projects from the source distribution and build it in CodeBlocks. CodeBlocks is able to import Microsoft Visual Studio projects and solutions and SDL2's source distribution comes packaged with a number of these.
If you are having trouble building SDL2 with CodeBlocks, SDL2's source distribution comes packaged with support for CMake. This will require some fairly simple command line/prompt input. I'm assuming that you are using the GCC compiler and GNU tool chain that is packaged with some CodeBlocks distributions. If this is the case, you already have everything you need to make use of CMake. The CMake website is here:
http://www.cmake.org/
The worst case scenario is that you will need to build SDL2 entirely from the command line using the source distribution's configure and Makefiles. Unfortunately, this option caters towards a Linux/Unix environment. Some of the software required for this comes packaged with GCC and the GNU tool chain via MinGW, but you will require MSYS to emulate a Linux/Unix console for this. You can get MSYS here:
http://www.mingw.org/wiki/msys
When all is said and done, I recommend you become familiar with command line tools in general. If you snoop around in CodeBlocks' settings and your project/solution's configurations, you will find many options that allow you to modify command line parameters. Try tinkering around with these tools in a command prompt; it's fun and will help you understand how the backend of software development works as compared to the IDE you typically work with.