i am writing an SDL / OpenGL application that runs under OSX. I have to use existing code which uses the DevIL library for loading JPG and PNG textures. Unfortunately, this
Have a look at the SDL_image library. It offers functions like IMG_LoadPNG that load your picture "as an" SDL_Surface.
Since you already work with SDL this should fit quite well in your program.
Sample taken from the SDL_image documentation:
// Load sample.png into image
SDL_Surface* image = IMG_Load("sample.png");
if (image == nullptr) {
std::cout << "IMG_Load: " << IMG_GetError() << "\n";
}