Complete newbie : Trying example in "Foundations of GTK+ Development"

I’m on Elementary OS (6.1) and I’m trying to use GTK for first time.

When I try the Helloworld example in the book and compile using

gcc -Wall -g helloworld.c -o helloworld pkg-config --cflags gtk+-3.0
pkg-config --libs gtk+-3.0

I’ve replaced gtk±2.0 with 3.0

I get the error

gcc -Wall -g helloworld.c -o helloworld pkg-config --cflags gtk+-3.0\ pkg-config --libs gtk+-3.0
Package ‘harfbuzz’ requires ‘glib-2.0 >= 2.19.1’ but version of glib-2.0 is 2.9.6
Package ‘pango’ requires ‘gobject-2.0 >= 2.59.2’ but version of gobject-2.0 is 2.9.6
gcc: error: : No such file or directory

I’ve tried installing latest GTK but fail at first hurdle installing Latest Python for latest Meson !!

Yours

Ian Clegg

Stay Safe In These Strange Days We Live In

Sounds like you’ve got a rather old version of glib, which is odd since I believe Elementary 6 is fairly recent?

You may need to ask in an Elementary forum as you appear to have got your packages in an odd state

Will Do !

Thanks for that.

Ian C

You must have done something that you haven’t told us. GLib 2.9.6 is an unstable development version released in February 2006. Honestly it looks like you’ve seriously trashed your system. I’m amazed that you’re able to boot to a desktop at all.

You were absolutely correct. Whatever I’d unintentionally done beforehand had really messed it up.
Says a lot about how resilient Elementary is that it kept running.
Worked first time with a fresh install.

Thank You for that !

Ian Clegg

Says a lot about how resilient Elementary is that it kept running.

Not really… there is really no chance it could possibly work with glib 2.9. Basically every program would crash immediately. No clue what you managed to do…