SDL2_image not found

mas4 picture mas4 · Oct 26, 2015 · Viewed 8.7k times · Source

I am trying to compile the following code which has the headers:

#include <SDL2/SDL.h>
#include <SDL2_image/SDL_image.h>

However after running the following makefile:

g++ -std=c++11 src/main.cpp -lSDL2 -lSDL2_image

I get the following error:

fatal error: SDL2_image/SDL_image.h: No such file or directory
#include <SDL2_image/SDL_image.h>

Any suggestions? Not entirely sure about my installation of SDL_image. I am running this on Ubuntu.

Answer

user6039980 picture user6039980 · Oct 21, 2017

This problem can be solved through installing libsdl2-image-dev package:

apt install libsdl2-image-dev