How to use GTK C library?
<p>I'm new at C and started to learn how to create GUI.
For some reason the only way program run is </p>

<pre><code> gcc simple.c -o simple -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 -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
</code></pre>

<p>If i just run <code>gcc simple.c</code>it gives me </p>

<pre><code>In file included from /usr/include/glib-2.0/glib/galloca.h:32:0,
             from /usr/include/glib-2.0/glib.h:30,
             from /usr/include/glib-2.0/gobject/gbinding.h:28,
             from /usr/include/glib-2.0/glib-object.h:23,
             from /usr/include/glib-2.0/gio/gioenums.h:28,
             from /usr/include/glib-2.0/gio/giotypes.h:28,
             from /usr/include/glib-2.0/gio/gio.h:26,
             from /usr/include/gtk-2.0/gdk/gdkapplaunchcontext.h:30,
             from /usr/include/gtk-2.0/gdk/gdk.h:32,
             from /usr/include/gtk-2.0/gtk/gtk.h:32,
             from graphical.c:1:/usr/include/glib-2.0/glib/gtypes.h:32:24: fatal error: glibconfig.h: No such file or catalog compilation terminated.
</code></pre>

<p>If I do other 'traditional' ways to include lib:</p>

<pre><code>gcc `pkg-config gtk+-2.0 --cflags` example.c -o example `pkg-config gtk+-2.0 --libs`
</code></pre>

<p>It gives me: </p>

<pre><code>Package gtk+-2.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `gtk+-2.0.pc' to the PKG_CONFIG_PATH environment variable
No package 'gtk+-2.0' found
graphical.c:1:21: fatal error: gtk/gtk.h: No such file or catalog
</code></pre>

<p>What is the right way to include GTK? </p>