Correct configuration of an SDL/C++ project in Gnome Builder?

Hello, I haven’t found anything in the wiki or on the internet on how to correctly configure a project in SDL/C++, using gnome builder.
Does anyone know a tutorial or a very secret video that explains very well how to configure it?
greetings :slight_smile:


zero? =(
cmake support?

There’s not enough context to give you an answer.

What does “configure correctly” mean?

What’s the SDL/C++ project?

Support where? What do you consider as “support”?

Hi. Since Builder has a good Meson build system support, you can look for meson sdl in your search engine.

Let’s follow this guide Building a simple SDL2 app from scratch :

  1. Create plain cpp meson project in Builder
  2. Replace main.cpp contents with the following code taken from mentioned link:
#include "SDL.h"

int main(int argc, char *argv[])
    SDL_Window *window;
    SDL_Renderer *renderer;
    SDL_Surface *surface;
    SDL_Event event;

    if (SDL_Init(SDL_INIT_VIDEO) < 0) {
        SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't initialize SDL: %s", SDL_GetError());
        return 3;

    if (SDL_CreateWindowAndRenderer(320, 240, SDL_WINDOW_RESIZABLE, &window, &renderer)) {
        SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't create window and renderer: %s", SDL_GetError());
        return 3;

    while (1) {
        if (event.type == SDL_QUIT) {
        SDL_SetRenderDrawColor(renderer, 0x00, 0x00, 0x00, 0x00);



    return 0;
  1. Add sdl2 dependency to src/ It should look like this:
sdl_tuto_sources = [

sdl_tuto_deps = [

executable('sdl-tuto', sdl_tuto_sources,
  dependencies: sdl_tuto_deps,
  install: true,
  1. You also will have to add additional permissions otherwise program will fail with ERROR: Couldn't initialize SDL: No available video device. Add 4 arguments to flatpak manifest file (more info at Welcome to Flatpak’s documentation! — Flatpak documentation):
    "finish-args" : [
    "cleanup" : [

And now it should launch.