# Compilation Errors Using GTK+ Library in C.



## Amberleaf (Dec 21, 2012)

I'm looking at this and using the exact examples shown here:
http://developer.gnome.org/gtk-tutorial/2.90/c39.html

I know GTK+2 is installed because it came with flash player 11 when I was setting up nswrapper. This is FreeBSD 8.3 if that is anything to note.

Here is an image showing the compilation errors:
http://i.imgur.com/5syju.png

Here is an image of the code:
http://i.imgur.com/OUMxW.png


```
#include <gtk/gtk.h>

int main( int   argc,
          char *argv[] )
{
    GtkWidget *window;
    
    gtk_init (&argc, &argv);
    
    window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
    gtk_widget_show  (window);
    
    gtk_main ();
    
    return 0;
}
```

Are there any other libraries that you suggest I use instead? A friend of mine from the unix hub IRC stated he uses xlib but he left before I had a chance to hear his opinion on it. He obviously prefers it over GTK.


----------



## SirDice (Dec 21, 2012)

Those libraries are in /usr/local/lib/ and /usr/local/include/ which aren't searched by default. Add -I and -L options.


----------



## Amberleaf (Dec 22, 2012)

Figured it out, I just need glib from the ports. Sorry for the hassle, I had to spend an hour in the IRC looking for the solution.


----------

