This is probably a dumb question with an easy fix, but I’m trying to compile something that uses sdl2 using a debian-based linux program. I’m using sudo apt install libsdl2-dev to install sdl2, but whenever I try to compile the program it says that I have the version 2.0.14, and I can’t figure out how to get the 2.28 version.
It seems you’re using Debian bullseye, since that’s the version of SDL2 in its package manager: Debian -- Details of package libsdl2-dev in bullseye
If you move from bullseye to Sid in the top right menu you can see it uses a higher version.
I primarily use Windows I’m sure not what the actual best practice here is. Compile from source? Upgrade your entire OS version because you want a newer library version?
AFAIK you’d have to build it from the source; the version available from the distro’s repository is always way behind. What features do you need that aren’t in 2.0.14?
Now SDL2 is entering a maintenance phase it will hopefully give the repositories a chance to catch up.