2020-04-10 08:04:00 |
Samuel Hangouët |
description |
Since update focal, libsdl2 and libsdl2-ttf headers have a different location, causing a compilation error when trying to include SDL2/SDL_ttf.h header :
$ sudo apt install libsdl2-ttf-dev libsdl2-dev
$ echo "#include <SDL2/SDL_ttf.h>" > main.c
$ gcc main.c
In file included from main.c:1:
/usr/include/SDL2/SDL_ttf.h:34:10: fatal error: SDL.h: Aucun fichier ou dossier de ce type
34 | #include "SDL.h"
| ^~~~~~~
compilation terminated.
It seems that SDL_ttf.h header expects to be in the same place that SDL ones, which is not the case :
$ dpkg -L libsdl2-ttf-dev
/.
/usr
/usr/include
/usr/include/SDL2
/usr/include/SDL2/SDL_ttf.h
...
$ dpkg -L libsdl2-dev
/.
/usr
/usr/bin
/usr/bin/sdl2-config
/usr/include
/usr/include/x86_64-linux-gnu
/usr/include/x86_64-linux-gnu/SDL2
/usr/include/x86_64-linux-gnu/SDL2/SDL.h
... |
Since update to focal, libsdl2 and libsdl2-ttf headers have a different location, causing a compilation error when trying to include SDL2/SDL_ttf.h header :
$ sudo apt install libsdl2-ttf-dev libsdl2-dev
$ echo "#include <SDL2/SDL_ttf.h>" > main.c
$ gcc main.c
In file included from main.c:1:
/usr/include/SDL2/SDL_ttf.h:34:10: fatal error: SDL.h: Aucun fichier ou dossier de ce type
34 | #include "SDL.h"
| ^~~~~~~
compilation terminated.
It seems that SDL_ttf.h header expects to be in the same place that SDL ones, which is not the case :
$ dpkg -L libsdl2-ttf-dev
/.
/usr
/usr/include
/usr/include/SDL2
/usr/include/SDL2/SDL_ttf.h
...
$ dpkg -L libsdl2-dev
/.
/usr
/usr/bin
/usr/bin/sdl2-config
/usr/include
/usr/include/x86_64-linux-gnu
/usr/include/x86_64-linux-gnu/SDL2
/usr/include/x86_64-linux-gnu/SDL2/SDL.h
... |
|