SOIL is a tiny C library used primarily for uploading textures into OpenGL. You can find the source code of SOIL at the official page.
The library can be used "as is" or compiled right on your computer. Unfortunately the static library downloaded for the mentioned page didn't work for me so I compiled it on my iMac 2017 with macos High Sierra on board.
This library was successfully tested with OpenGL while making a small 2D game.
Just clone or dowload the library as well as header file and use it while compiling your program.