No message system available error after SDL_ShowSimpleMessageBox

I’m trying to launch a simple message box in my program
System is Arch Linux with sdl2 version == 2.0.12-2
Using GNOME with X11 backend
And my code is:

static void showLinuxMessageError(const std::string message)
{
if(SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Service Error", message.c_str(), NULL))
	std::cerr << "SDL_ShowSimpleMessageBox error: " << SDL_GetError() << std::endl;
}

The code runs after SDL_Init() and before SDL_Quit()
The error I get shows:

SDL_ShowMessageBox error: No message system available

I have created a SDL_Window object in another class, but I don’t want to pass it here (supposed to be static function).
Any solutions?

I found a possible alternative on Linux.
libnotify
Seems that it is limited to GNOME, but it works well and easy to implement.

You’re probably missing fonts X11 needs for the message. Try installing pacman -Sy xorg xorg-fonts

1 Like

I can confirm this works. I had the same problem, installed the xorg-fonts (though I’m in a Wayland session) and now it works.