[ubuntu-uk] GTK and C

Greg Dash greg.dash1 at gmail.com
Wed Nov 15 15:24:28 GMT 2006

Hello, my proper post :-)

I am quite new to Linux and C/C++ programming but I wanted to try and
create some GUI with GTK as they have good tutorials with C, I just
Anjuta to write and compile the application. I have GTK Libs and GTK
Dev packages installed, I install them via Synaptic. The program I'm
trying to compile is:

// File: gtk2.c
#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;

 The problem is I cannot compile the program I have added GTK to the
compiler and Linker options and this removed one error saying GTK.H
could not be found. but I am still unable to successfully compile the
application, the errors I get from Anjuta are:

gcc `gtk-config --cflags`  -Wimplicit "gtk2.c" -lgtk` gtk-config
--libs` -o "gtk2"
gcc: `gtk-config: No such file or directory
cc1: error: unrecognised command line option "-fcflags`"
cc1: error unrecognised command line option "-flibs`"
Completed... unsuccessful

I thought it might be that I don't have all the libraries and dev
files but I apper (as fair as I know) to, Thanks in advance,

More information about the ubuntu-uk mailing list