libsdl2-ttf-dev and libsdl2-dev headers not at the same place, causing compilation error
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
libsdl2-ttf (Ubuntu) |
Confirmed
|
Undecided
|
Unassigned |
Bug Description
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/
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/
...
$ dpkg -L libsdl2-dev
/.
/usr
/usr/bin
/usr/bin/
/usr/include
/usr/include/
/usr/include/
/usr/include/
...
summary: |
- libsdl2-ttf-dev headers and libsdl2-dev headers not at the same place, - causing compilation error + libsdl2-ttf-dev and libsdl2-dev headers not at the same place, causing + compilation error |
description: | updated |
affects: | launchpad → libsdl |
affects: | libsdl → libsdl2-ttf (Ubuntu) |
tags: | added: focal |
Since last update, the problem has moved, now this error happens:
In file included from /usr/include/ SDL2/SDL. h:32: SDL2/SDL_ main.h: 25: SDL2/SDL_ stdinc. h:31: SDL2/SDL_ config. h:4: x86_64- linux-gnu/ SDL2/_real_ SDL_config. h:33: x86_64- linux-gnu/ SDL2/SDL_ platform. h:179:10: fatal error: 'begin_code.h' file not found
In file included from /usr/include/
In file included from /usr/include/
In file included from /usr/include/
In file included from /usr/include/
/usr/include/
#include "begin_code.h"
A workaround is to add -I/usr/include/SDL2 into compiling flags, but not very clean.