Why is libdecor required on deployment?


I have recently integrated SDL 2.26.5 into my Qt project with dynamic linking. I made a “hello world” just to test deployments:

#include <SDL.h>

int main() {
  if (SDL_Init(SDL_INIT_EVERYTHING) < 0) {
    return 1;

On Windows, I link against libmingw32, libSDL2main, and libSDL2, while on Linux, I link against libSDL2 only. Both lists are based on the output of sdl2-config, and I deploy libSDL2 (dll, or so based on platform) to users.

The Windows deployment works perfectly on a laptop without dev tools installed, however I get an error for missing libdecor on a tester laptop with Ubuntu 20.04. As far as I know, libdecor is related to Wayland, but both the tester laptop and my development PC are using X11. My development PC has many tools installed, so it has libdecor as well, I tried to deploy libdecor with my binary, which strangely caused “Segmentation fault (core dumped)” on the tester laptop. My deployment was verifiably correct before integrating SDL. I also ran ldd, and objdump on my binary, and neither of them showed any trace of libdecor, while they showed a dependency on libSDL2 correctly.

Please help find the issue here. It’s possible the mentioned tester laptop with Ubuntu 20.04 has some very old packages (although I ran apt-get update && upgrade before these tests), I am still waiting on feedback from other Linux users, and if they see an issue with libdecor.


In case anyone finds this in the future, here’s the answer:

My Ubuntu 22.04 has a preinstalled (I am guessing it came with some dev packages) SDL, and mistakenly I deployed that with my project. However that SDL is older and not complete, so it needed libdecor to fully support Wayland. I changed my deployment script to properly take the fresh SDL I built on the dev machine, and now libdecor isn’t required during runtime. So, check if you are deploying / linking the right SDL version if you have this problem.

1 Like