GTK environment setup
Hi all, after some troubles I got to setup almost all the GTK devel packages and now I'm trying to compile a program from the "Beginning Linux Programming" book (3rd edition).
The problem is that the gcc compiler doesn't recognize the:
#include <gtk/gtk.h>
saying no such file or directory.
so when I'm hardcoding it like this:
#include "/usr/include/gtk-2.0/gtk/gtk.h"
the compiler issues a lot of unresolved headers like:
$ gcc gtk1.c -o gtk1 `pkg-config -cflags -libs gtk+-2.0`
-cflags: unknown option
In file included from gtk1.c:1:
/usr/include/gtk-2.0/gtk/gtk.h:31:21: error: gdk/gdk.h: No such file or directory
/usr/include/gtk-2.0/gtk/gtk.h:32:32: error: gtk/gtkaboutdialog.h: No such file or directory
/usr/include/gtk-2.0/gtk/gtk.h:33:31: error: gtk/gtkaccelgroup.h: No such file or directory
I think there should be some environment variable telling the compiler where to look for the header files. BUT it looks like although the pkg-config program is there - it doesn't work correctly since it complains "-cflags: unknown option".
Someone please tell me how to setup the compiler or my environment to get the code to compile, here's the code of the simple app:
#include "/usr/include/gtk-2.0/gtk/gtk.h"
//<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;
}
|