This book is a needed and well conceived addition to the Raspberry Pi theme of training future programmers. The bug that you have identified is a tragedy, because the student has found his sea legs (C legs) by working through the basic C lessons in the first half of the book, and is ready to jump into GUI programming with GTK --- but the first example (the foundation) FAILS!!! What a downer!!! In my case, I was a programmer and systems guy in Mfg. for 40+ years before retirement.. including Unix workstations. I have an idea for an app that I would like to develop for the Rpi using C & the GTK GUI. Here I am, "sucking wind," instead of sailing along! I'm sure that the two of us are not alone! Hundreds, or perhaps thousands, of our coding brothers and sisters are hanging up on this one, depending on Simon Long's book sales! I have tried a few ideas, described below.
Calling the attempt in the book to compile the author's C GTK program Try # 1, I tried two variations that didn't work, plus an attempt to compile the same "Tries" using the Ubuntu Mate 18,04.3 OS on my desktop. Ubuntu Mate failed in exactly the same way as you and I (and many other faithful vineyard toilers) discovered.on the Rpi.
My suspicion is that Simon Longs code is OK, but that a "regression" has crept into the C compiler preprocessor (maybe), or into the GTK routines (more likely) that we are trying to use in Simon's example.
Try #2 was to pipe the output from 'pkg-config --cflags --libs gtk+-2.0' into a named file in our working directory, and then to try the compile using the named file replacing the 'pkg-config ...' character string in gcc filename gtktest.c -o gtktest. The C preprocessor didn't object to the substitution, but still failed trying to find a include file.
The interesting thing is that the files being looked for are present in the correct directories!
Try #3 was to place all of the output include files from the "pkg-config --cflags --libs gtk+-2.0' phrase into the compile command gcc ..-v -pthread -I/usr/include/gtk-2.0 ... gtktest.c -o gtktest. Doing this produces a long compile command, and the C preproccessor again does not object to the syntax, but fails looking for different include files. I have saved the terminal output from all of this if you want to see it. I made these Tries on the RaspberryPi 4, first, and then on the Raspberry Pi 3b+. As I mentioned above, Ubuntu Mate also fails the same way. I'm thinking I should try again with Debian OS, because I seem to remember that both Raspbian and Ubuntu are derived from that OS. If Simon's GTK program also fails the same way on Debian, it would seem to exonerate Simon, Raspbian, UbuintuMate and Debian .... meaning that the problem is with GTK or the C compiler. Perhaps we could ask Simon to use his vast influence to get knowledgeable gurus to fix such basic flaws.
Best Regards From Northern Illinois, USA,