Getting Started with Gtk4 on Ubuntu PopOS! 22.04

Free Folk Create Free Software

Install Cambalache 0.12 (optional)

Cambalache is a new RAD tool for Gtk 4 and 3 with a clear MVC design and data model first philosophy. This translates to a wide feature coverage with minimal/none developer intervention for basic support.

See the following link for further instructions on setting up Cambalache.

At the moment, I am having trouble getting Cambalache compiled from source on my machine. I have not tested other installation methods.

More details are here if curious:

Getting a Ubuntu 22.04 desktop environment ready for compiling libgtkmm

To install libgtkmm-4.0 on PopOS! 22.04, we will need to configure and build it manually from source since it isn't available on Ubuntu's PPA 22.04 as a package.

From some public research, PopOS! 24.04 will ease the setup process without having to build from scratch. I personally couldn't wait and wanted to get up and running with gtk4 ASAP. Gtk4 has some super improvements and you may view some of these improvements by searching with your favorite search engine.

Install Build Dependencies for gtkmm-4.0

To build gtkmm-4.0, I followed this documentation from, but I added up-to-date packages in this article. Plus, I am using PopOS! 22.04 for this tutorial and ran into some other issues while getting gtkmm-4.0 up and running.

Determining what deps you need to install gtk4 is located here:

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 \

Next, we need SigC++-3.4.0

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

Next, we install glibmm-2.68

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

Next, we compile and install cairomm

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

And finally, we compile and install pangomm-2.50

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

Compile and Install gtkmm-4.6.1

Note: Installing Gtkmm-4.9.3 resulted in a version mismatch on Ubuntu PopOS! 22.04.

configure: error: Package requirements (giomm-2.68 >= 2.68.0 pangomm-2.48 >= 2.50.0 cairomm-1.16 >= 1.15.4 gtk4 >= 4.9.3 gdk-pixbuf-2.0 >= 2.35.5) were not met:
Requested 'gtk4 >= 4.9.3' but version of GTK is 4.6.9

Tip: To list the available libgtk versions, Mark Baker on stackoverflow shared how to view this.
dpkg -l libgtk* | grep -e '^i' | grep -e 'libgtk-*[0-9]'

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

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

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/

This will solve problems when running the program.

Next, we probably want to get started with GNU's Autotools

Autotools cleans up the build process and makes building, distributing and installing C++ apps a breeze.

sudo apt install autotools

After installation, we build our example application that includes our new gtkmm 4.6.1.


Our example base.cpp application that uses gtkmm wrapper.

#include <gtkmm.h>
class MyWindow : public Gtk::Window
 set_title("A HTMX Web Browser with GTK4!");
 set_default_size(400, 400);
int main(int argc, char* argv[])
 auto app = Gtk::Application::create("org.gtkmm.examples.base");
 return app->make_window_and_run<MyWindow>(argc, argv);


AC_INIT([cplusplus_gtk4_app_skeleton], [0.1], [[email protected]])
AC_PREREQ([2.68]) # autoconf version >= 2.68
AC_CONFIG_AUX_DIR([build-aux]) # Auxiliary files go here
PKG_CHECK_MODULES([cplusplus_gtk4_app_skeleton], [gtkmm-4.0 >= 4.6.1])
# Put various checks and such here.


AUTOMAKE_OPTIONS = gnu dist-xz  # sets automake standards
bin_PROGRAMS = cplusplus_gtk4_app_skeleton
AM_CXXFLAGS = $(shell pkg-config --cflags gtkmm-4.0)
LIBS = $(shell pkg-config --libs gtkmm-4.0)
cplusplus_gtk4_app_skeleton_SOURCES = base.cpp

Let autotools do the work!

In the root of your project, we setup autotools and initialize the project.


Shipping Your GNU Cplusplus App (optional)

Creating the binaries and shipping them is ease as pie!

make dist

Install Your Free GNU Cplusplus App (optional)

Installation is breezy lemon squeezy!

sudo make install

Building Your Cplusplus App

After changes are made to our program, we need to re-build the binary and launch it from command line.


Financial Support & Donations

I mainly debug code, drive, yak shave and deep dive into research for Linux base operating systems.

I am a Free Software Associate (FSF), privacy advocate and Cosmopolitan that enjoys philosophie, meta-physics, hacking and debugging computer hardware/software.

  • Liberapay is a recurrent donations platform
  • Run by a non-profit organization
  • Source code is public
  • No commission fee
  • ~5% payment processing fee


  1. Autotools:
  2. Build Dependencies for Gtk4:
  3. Cairomm:
  4. DocBook:
  5. Cambalache:
  6. Gstreamer:
  7. GTK3 & GTK4:
  8. Gtkmm C++ Interpreter:
  9. How-to Install Gtkmm-4 on Ubuntu 22.04:
  10. LibsigC++ 3.4 Download:
  11. Linux Gtk Glade Programming Part 1:
  12. Stackoverflow Mark Baker - Version of GTK on Ubuntu:
  13. Cambalache Debugging on Ubuntu 22.04: