title: gtk/gtk.h not found on Ubuntu c++
body: <p>I'm rather new to programming and especially when it comes to how to including libraries and alike activities. I've been programming a bit using Python in the past and I've been using GTK to create windows, something I've intended to do when programming with c++ as well. To get things started, here's my code:</p>
  
  <pre><code>#include &lt;stdlib.h&gt;
  #include &lt;gtk/gtk.h&gt;
  
  static void helloWorld (GtkWidget *wid, GtkWidget *win)
  {
    GtkWidget *dialog = NULL;
  
    dialog = gtk_message_dialog_new (GTK_WINDOW (win), GTK_DIALOG_MODAL, GTK_MESSAGE_INFO, GTK_BUTTONS_CLOSE, "Hello World!");
    gtk_window_set_position (GTK_WINDOW (dialog), GTK_WIN_POS_CENTER);
    gtk_dialog_run (GTK_DIALOG (dialog));
    gtk_widget_destroy (dialog);
  }
  
  int main (int argc, char *argv[])
  {
    GtkWidget *button = NULL;
    GtkWidget *win = NULL;
    GtkWidget *vbox = NULL;
  
    /* Initialize GTK+ */
    g_log_set_handler ("Gtk", G_LOG_LEVEL_WARNING, (GLogFunc) gtk_false, NULL);
    gtk_init (&amp;argc, &amp;argv);
    g_log_set_handler ("Gtk", G_LOG_LEVEL_WARNING, g_log_default_handler, NULL);
  
    /* Create the main window */
    win = gtk_window_new (GTK_WINDOW_TOPLEVEL);
    gtk_window_set_default_size(GTK_WINDOW (win), 400, 300);
    gtk_container_set_border_width (GTK_CONTAINER (win), 8);
    gtk_window_set_title (GTK_WINDOW (win), "test");
    gtk_window_set_position (GTK_WINDOW (win), GTK_WIN_POS_CENTER);
    gtk_widget_realize (win);
    g_signal_connect (win, "destroy", gtk_main_quit, NULL);
  
    /* Create a vertical box with buttons */
    vbox = gtk_vbox_new (TRUE, 6);
    gtk_container_add (GTK_CONTAINER (win), vbox);
  
    button = gtk_button_new_from_stock (GTK_STOCK_DIALOG_INFO);
    g_signal_connect (G_OBJECT (button), "clicked", G_CALLBACK (helloWorld), (gpointer) win);
    gtk_box_pack_start (GTK_BOX (vbox), button, TRUE, TRUE, 0);
  
    button = gtk_button_new_from_stock (GTK_STOCK_CLOSE);
    g_signal_connect (button, "clicked", gtk_main_quit, NULL);
    gtk_box_pack_start (GTK_BOX (vbox), button, TRUE, TRUE, 0);
  
    /* Enter the main loop */
    gtk_widget_show_all (win);
    gtk_main ();
    return 0;
  }
  </code></pre>
  
  <p>The code was taken from a "Hello world" example I found on the internet a while back.</p>
  
  <p>I'm aware that this issue have already gotten an answer, but my situation is much more complex (from my perspective at least). First off, I've installed all packages required. I run Ubuntu 14.04 by the way.</p>
  
  <p>When I compile the code using <code>g++ main.cpp</code> I get the following error:</p>
  
  <pre><code>main.cpp:2:21: fatal error: gtk/gtk.h: No such file or directory
   #include &lt;gtk/gtk.h&gt;
                       ^
  compilation terminated.
  </code></pre>
  
  <p>There is a fix for this particular error, which is to extend the compile command like this: <code>g++ main.cpp -I/usr/include/gtk-2.0</code>. This however will provide another, similar error:</p>
  
  <pre><code>In file included from /usr/include/gtk-2.0/gdk/gdk.h:32:0,
                   from /usr/include/gtk-2.0/gtk/gtk.h:32,
                   from main.cpp:2:
  /usr/include/gtk-2.0/gdk/gdkapplaunchcontext.h:30:21: fatal error: gio/gio.h: No such file or directory
   #include &lt;gio/gio.h&gt;
                       ^
  compilation terminated.
  </code></pre>
  
  <p>You can fix this as well by extending the command like this (all commands are fund on the internet and I don't quite understand it all): <code>g++ -g -Wall -c -o program.o main.cpp -I/usr/include/gtk-2.0 $(pkg-config --libs --cflags glib-2.0)</code>. There will now be an error with <code>cairo.h</code>.</p>
  
  <p>As you can see there are similar errors. I have no idea what's wrong but I must believe there is a relatively easy fix.</p>
  
  <p>Also, I tried a fresh install of Ubuntu (just installed packages necessary) and the same errors occur.</p>