You generally build such GTK programs using pkg-config. And I am getting (on Debian/Sid/AMD64) the compile flags
% pkg-config --cflags gtk+-x11-3.0
-pthread -I/usr/include/gtk-3.0 -I/usr/include/atk-1.0 \
-I/usr/include/at-spi2-atk/2.0 -I/usr/include/pango-1.0 \
-I/usr/include/gio-unix-2.0/ -I/usr/include/cairo \
-I/usr/include/gdk-pixbuf-2.0 -I/usr/include/glib-2.0 \
-I/usr/lib/x86_64-linux-gnu/glib-2.0/include \
-I/usr/include/harfbuzz -I/usr/include/freetype2 \
-I/usr/include/pixman-1 -I/usr/include/libpng12 \
-I/usr/include/libdrm
and the link flags
% pkg-config --libs gtk+-x11-3.0
-lgtk-3 -lgdk-3 -latk-1.0 -lgio-2.0 -lpangocairo-1.0 \
-lgdk_pixbuf-2.0 -lcairo-gobject -lpango-1.0 -lcairo \
-lgobject-2.0 -lglib-2.0
Notice that these shared libraries link some other ones (eg -lX11
or -ldbus
). Try to ldd
some GTK binary (e.g. your own one, or gedit
)
NB: I have manually added the backslashes and newlines for readability
However, there are much more other runtime dependencies: the X11 server and related things (session and windows managers, fonts and images notably and perhaps even some "desktop" environment à la Gnome or IceWM, etc...).
I suggest installing GTK usig the package system (e.g. using aptitude install
on Ubuntu) with a network connection (perhaps using a chroot-ed environment) to understand all the dependencies.