PeterW
March 14, 2026, 10:35am
1
I’m using Ubuntu 22.04 and try to compile an official Gtk example from the website Gtk – 3.0: Getting Started with GTK
I already installed glib dev packages version 2.0 and 3.0. But when compiling I get an error that glib.h can’t be found.
What’s wrong?
ebassi
(Emmanuele Bassi)
March 14, 2026, 12:55pm
2
There’s not much anybody can say if you don’t specify:
which packages you installed
which commands you used
what kind of errors you’re getting
The documentation explains how to compile a C source file, and your distribution’s packages take care of the dependencies.
PeterW
March 14, 2026, 1:12pm
3
Thanks for the answer. That was the reason. I forgot to phrase the pkg-config part so the compiler couldn’t find the include file for glib. I get a different error but this is solved.
tragivictoria
(Victoria Niedzielska🏳️⚧️)
March 14, 2026, 4:09pm
4
You can click checkbox next to heart button to mark as an answer