Compile SDL2 for Raspi 4 with X11


is there any resource available to compile SDL2 for Raspberry Pi 4 with use of X11? I did not find any tutorial covering that. When I compile it with the default options on a fresh default raspbian, I get “Could not initialize EGL”.


I don’t use egl but i’m developping a game raspberry pi myselve and already have it running under x11. I just used the default developpers packages availabe in the repo’s using sudo apt-get install method. I also use sdlmixer, sdlimage, sdlgfx from the repo’s without a problem on raspian buster.

I use the prebuilt binary available from the Raspbian Buster repository; it works fine with the standard desktop, so I don’t need to compile SDL2 at all:

sudo apt-get install libsdl2-2.0-0