[Solved] Glib.h not found

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?

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.

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.

You can click checkbox next to heart button to mark as an answer