0

I was trying to compile a C project but the compiler says that SDL image is not installed despite the fact that SDL image is clearly installed.

Output Of DNF Command:

Package SDL_image-devel-1.2.12-31.fc37.x86_64 is already installed.
Dependencies resolved.
Nothing to do.
Complete!

Output Of C Compiler:

src/assets.c:4:10: fatal error: 'SDL2/SDL_image.h' file not found
#include <SDL2/SDL_image.h>
         ^~~~~~~~~~~~~~~~~~
1 error generated.
src/main.c:8:10: fatal error: 'SDL2/SDL_image.h' file not found
#include <SDL2/SDL_image.h>
         ^~~~~~~~~~~~~~~~~~
1 error generated.
src/screen.c:4:10: fatal error: 'SDL2/SDL_image.h' file not found
#include <SDL2/SDL_image.h>
         ^~~~~~~~~~~~~~~~~~
1 error generated.
In file included from src/world.c:4:
src/assets.h:5:10: fatal error: 'SDL2/SDL_image.h' file not found
#include <SDL2/SDL_image.h>
         ^~~~~~~~~~~~~~~~~~
1 error generated.


I've tried removing and re-installing the package but that did not appear to work. I've googled but I can't seem to find anyone else with this problem.

  • Get a full listing of the files installed by the package (eg `rpm -ql $package` or `dpkg-query -L $package`) and see where the header files are installed. Add that path to `-I` – William Pursell May 09 '23 at 11:16

1 Answers1

1

There are two independent branches of SDL_image - SDL_image for SDL 1.2, and SDL2_image for SDL2. So you need to install SDL2_image-devel. And link with SDL2_image.

keltar
  • 17,711
  • 2
  • 37
  • 42