So on the road to create a GUI for REN-C. Chosen for GTK as a first target. Taking the smallest steps possible to get a deep understanding of the nature of that beast.
Followed the steps on https://developer.gnome.org/gtk3/stable/gtk-getting-started.html to get the simplest examples compiled on my Ubuntu system.
Learning about backticks (that horrible sign that is not a normal single quote: ‘`’ ) from here https://developer.gnome.org/gtk3/stable/gtk-compiling.html that they can be used to copy a result of a command in the command that is being executed.
So I created my example-0.c file and tried to compile
gcc `pkg-config --cflags gtk+-3.0` -o example-0 example-0.c `pkg-config --libs gtk+-3.0`
But it failed
Package gtk+-3.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `gtk+-3.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'gtk+-3.0' found
Package gtk+-3.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `gtk+-3.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'gtk+-3.0' found
example-0.c:1:10: fatal error: gtk/gtk.h: Bestand of map bestaat niet
#include <gtk/gtk.h>
^~~~~~~~~~~
compilation terminated.
It is evident that even though I run Ubuntu that uses GNOME(3) and thus must know how to handle the GTK all its stuff is made for, when compiling the headers must be present somewhere, and they are not. So I needed to install them. The search engine is your friend so I found out what to do:
sudo apt-get install libgtk-3-dev
This got 22MB of archives and 105MB installed stuff down to the computer.
But now in usr/include there is a folder gtk-3.0 installed and pkg-config –cflags gtk+-3.0 now does return a result. The programs can be compiled now using the strings suggested an the generated programs do what they are supposed to do.
To see what packages concerning GTK are installed, this command can also come in handy, I found it using the search engine friend.
dpkg -l libgtk* | grep -e '^i' | grep -e 'libgtk-*[0-9]'
Having it here is convenient I guess.
Till next blog!