MavericksにGTKをインストール

http://www.myu.ac.jp/~xkozima/lab/raspTutorial2.html
ここを参考に。
インストールに以下の行程が必要だった。
https://github.com/Homebrew/homebrew/issues/14123

$ sudo cp /opt/X11/lib/pkgconfig/*.pc /usr/local/lib/pkgconfig

サンプル

#include <gtk/gtk.h>
void main (int argc, char *argv[])
{
    //  親ウィンドウと GUI 要素(のポインタ変数)
    GtkWidget *window, *label;
    //  gtk+ の初期化(オマジナイ)
    gtk_init(&argc, &argv);

    //  親ウィンドウの生成(+殺し方の指定)
    window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
    g_signal_connect(window, "delete-event",
                     G_CALLBACK(gtk_main_quit), NULL );
    //  ラベルの生成(+親ウィンドウへの配置)
    label = gtk_label_new("Hello, world!");
    gtk_container_add(GTK_CONTAINER(window), label);

    //  GUI 要素・親ウィンドウの表示
    gtk_widget_show(label);
    gtk_widget_show(window);

    //  イベント処理ループ
    gtk_main();
}

ビルド方法

$ gcc main.c  `pkg-config --cflags --libs gtk+-3.0` 

pkg-configの使い方

$ pkg-config (ライブラリ名) (オプション)
$ pkg-config gtk+-3.0 --cflags --clibs
-D_REENTRANT -I/usr/local/Cellar/gtk+3/3.12.1/include/gtk-3.0 -I/usr/local/Cellar/at-spi2-atk/2.12.1/include/at-spi2-atk/2.0 -I/usr/local/Cellar/gtk+3/3.12.1/include/gtk-3.0 -I/usr/local/Cellar/glib/2.40.0/include/gio-unix-2.0/ -I/opt/X11/include -I/opt/X11/include/cairo -I/usr/local/Cellar/pango/1.36.3/include/pango-1.0 -I/usr/local/Cellar/harfbuzz/0.9.27/include/harfbuzz -I/usr/local/Cellar/pango/1.36.3/include/pango-1.0 -I/usr/local/Cellar/atk/2.12.0/include/atk-1.0 -I/usr/local/Cellar/cairo/1.12.16_1/include/cairo -I/opt/X11/include/cairo -I/usr/local/Cellar/pixman/0.32.4/include/pixman-1 -I/usr/local/Cellar/fontconfig/2.11.1/include -I/usr/local/Cellar/freetype/2.5.3_1/include/freetype2 -I/opt/X11/include/libpng15 -I/opt/X11/include -I/usr/local/Cellar/gdk-pixbuf/2.30.7/include/gdk-pixbuf-2.0 -I/opt/X11/include/libpng15 -I/usr/local/Cellar/glib/2.40.0/include/glib-2.0 -I/usr/local/Cellar/glib/2.40.0/lib/glib-2.0/include -I/usr/local/opt/gettext/include -L/usr/local/Cellar/gtk+3/3.12.1/lib -L/usr/local/Cellar/pango/1.36.3/lib -L/usr/local/Cellar/atk/2.12.0/lib -L/usr/local/Cellar/cairo/1.12.16_1/lib -L/opt/X11/lib -L/usr/local/Cellar/gdk-pixbuf/2.30.7/lib -L/usr/local/Cellar/glib/2.40.0/lib -L/usr/local/opt/gettext/lib -lgtk-3 -lgdk-3 -lpangocairo-1.0 -lpango-1.0 -latk-1.0 -lcairo-gobject -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lgobject-2.0 -lglib-2.0 -lintl