No available video device error (Ubuntu 20.04)

So I keep getting this error when following the lazy foo tutorial series. I’ve been through a lot of posts and nothing has seemed to work. The program just creates a windows, waits then closes it.

I’ve tried setting SDL_VIDEODRIVER to x11 and I then get an error that x11 is unavailable instead of the above. x11 definitely is installed though so I’m not sure why it’s not detecting it.

Notably when I first ran the program it did open the window. Not sure what has changed but I’ve been unable to remedy it. Any suggestions on how to try and fix it?

Cheers