How to install GTKMM 4 on Ubuntu 22.04

As of the time of this article the only version available in the repository is 3.0 .

Synfig Studio, made with gtkmm

Synfig Studio is one of several software that was made with gtkmm

gtkmm-4.0 has several new improvements and features.

In this article we will see how to compile on Ubuntu 22.04 .

Before following this tutorial, check if version 4 is already available in the repository, as some distros already have it. But anyway, it will serve as a learning experience or for new versions! 😃


Install build dependencies

By default, GNOME uses Meson, but in all packages there is an alternative to compile with GNU Autotools, in this case we will compile everything with Autotools:

It’s also good to have gtkmm-3.0 to solve other dependencies. In addition to Gtk4 .

sudo apt install build-essential git g++ autotools-dev libgtkmm-3.0-dev \
         libgtkmm-3.0-doc mm-common libgtk-4-bin \
         libgtk-4-common libgtk-4-dev libgtk-4-doc pkg-config

Now let’s use the updated versions, without them you can’t continue, click on the links if there is already a newer version, download the latest one. It accepts these versions or higher.

You must have SigC++-3.07:

tar Jxvf libsigc++-3.0.7.tar.xz
cd libsigc++-3.0.7/
./ --prefix=/usr/local
sudo make install

It is necessary to have giomm-2.68 and to get it we compile/install glibmm-2.68:

tar Jxvf glibmm-2.68.2.tar.xz
cd glibmm-2.68.2/
./ --prefix=/usr
sudo make install

You must have the latest version of cairomm:

git clone
cd cairomm
./ --prefix=/usr
sudo make install

And finally pangomm-2.50:

tar Jxvf pangomm-2.50.0/
cd pangomm-2.50.o/
./ --prefix=/usr
sudo make install

If you want to see the path where they are all installed see here .

Compile and install gtkmm-4.0

Download and check the hash

sha256sum -c --ignore-missing gtkmm-4.6.1.sha256sum

If it appears: gtkmm-4.6.1.tar.xz: SUCCESS, everything is ok and we can proceed, if not, download the files again.

Unzip, compile and install

tar Jxvf gtkmm-4.6.1.tar.xz
cd gtkmm-4.6.1
./ --prefix=/usr
sudo make install


Run the command:

ls /usr/lib/libsigc-3*

If you don’t find anything, CREATE these symlinks:

sudo ln -s /usr/local/lib/ /usr/lib/
sudo ln -s /usr/local/lib/ /usr/lib/
sudo ln -s /usr/local/lib/ /usr/lib/
sudo ln -s /usr/local/lib/ /usr/lib/

If any of them are not in /usr/local/lib, just ignore them and create only the ones that exist.

This will solve problems when running our program!

Testing gtkmm-4.0

Create a file with any name, for example main.cpp and insert the content below:

#include <gtkmm.h>

class MyWindow : public Gtk::Window {

  set_title("Basic application");
  set_default_size(800, 450);

int main(int argc, char ** argv){
  auto app = Gtk::Application::create("org.gtkmm.examples.base");
  return app->make_window_and_run<MyWindow>(argc, argv);

Compile and run:

g++ main.cpp $(pkg-config gtkmm-4.0 --cflags --libs)

If all steps were followed correctly, this window will appear:

gtkmm-4.0 running

Useful links

gtkmm cpp cppdaily


YouTube channel


Marcos Oliveira

Marcos Oliveira

Software developer

Related articles