sudo apt-get install libgtk-3-dev
Using In Your Project
Update your makefile to use the gtk libs and cflags:
LIBS = `pkg-config --libs gtk+-3.0` CFLAGS = `pkg-config --cflags gtk+-3.0`
Include gtk and get programming – see here.
Using In A NetBeans For Windows Project
Go to: Project Properties > Build > Linker > Compilation Line > Additional Options > paste in this:
`pkg-config –cflags gtk+-3.0` `pkg-config –libs gtk+-3.0`
Note the single quote marks are correct and should be used as is!
Now you need to add all of the directories used by the gtk libraries – dull but necessary… Use this command:
pkg-config --cflags gtk+-3.0
Which will give you an output like this:
pkg-config --cflags gtk+-3.0 -pthread -I/usr/include/gtk-3.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/at-spi-2.0 -I/usr/include/dbus-1.0 -I/usr/lib/arm-linux-gnueabihf/dbus-1.0/include -I/usr/include/gtk-3.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/pango-1.0 -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng12 -I/usr/include/glib-2.0 -I/usr/lib/arm-linux-gnueabihf/glib-2.0/include
Convert it into a list of directories and delete any duplicates, so you end up with something like this:
/usr/include/gtk-3.0 /usr/include/at-spi2-atk/2.0 /usr/include/at-spi-2.0 /usr/include/dbus-1.0 /usr/lib/arm-linux-gnueabihf/dbus-1.0/include /usr/include/gio-unix-2.0/ /usr/include/cairo /usr/include/pango-1.0 /usr/include/harfbuzz /usr/include/atk-1.0 /usr/include/pixman-1 /usr/include/freetype2 /usr/include/libpng12 /usr/include/gdk-pixbuf-2.0 /usr/include/glib-2.0 /usr/lib/arm-linux-gnueabihf/glib-2.0/include
Go to: Project Properties > Build > C++ Compiler > General > Include Directories > and add in each one. For the first one you can paste the line in even though an open file dialog is shown but you may need to go back and edit it to make it right. For subsequent ones you can simply 'duplicate' and then 'edit' to add each as a new entry.
This it, add this to your project source file and off you go.