I created this a short while back hope it helps some of you.
This tutorial shows how to install code blocks, mingw-w64, SDL2, Compile GLEW 2.0, and get a basic opengl 3.3 through 4.5 program running.
Bat file used to compile GLEW
http://www.grhmedia.com/glew/compile.64.bat 64bit
http://www.grhmedia.com/glew/compile.bat 32bit
The project
http://www.grhmedia.com/tutorials/BasicSDLOGLTest.zip
Precompile glew for 64 bit mingw
http://www.grhmedia.com/glew/glew-2.0.0-mingw-w64.zip 64bit
http://www.grhmedia.com/glew/glew-2.0.0-mingw.zip 32bit
The larger project with triangle
http://www.grhmedia.com/tutorials/SDLOGL02_64bit_recent.zip