Re: Question about include paths

"Carl B. Constantine" <duckwing duckwing ca> writes:

> I'm developing a GTK+ 2 app with Anjuta. For the most part, the glade
> generated files include gnome.h. I have one file where all I really
> want/need is gtk.h. The problem comes with the fact that I have both gtk
> 1.2 and gtk 2 installed on my system. So a locate gtk.h comes up thus:
> (duckwing Mallard:src)$ locate gtk.h                                      
> /usr/share/doc/texmf/help/Catalogue/entries/dvgtk.html
> /usr/share/doc/ebook-dev-ggad/html/cha-gtk.html
> /usr/share/doc/libgtk2.0-doc/gtk/gtk.html
> /usr/share/gimp/1.2/help/C/dialogs/color_selectors/gtk.html
> /usr/share/devhelp/books/gtk-1.2/gtk.html
> /usr/include/gtk-1.2/gtk/gtk.h
> /usr/include/gtk-2.0/gtk/gtk.h
> So how should I include gtk.h? should it be:
> a) #include <gtk/gtk.h>
> b) #include <gtk-2.0/gtk/gtk.h>
> c) #include <gtk.h>
> ?
> similarly, gnome.h actually has the first one. should it be changed
> maybe if I want to use gtk2?
> Note: I do not have gnome2 installed on this particular system. I do
> have it installed on my laptop though (which is running Gentoo).
> any help is appreciated.

You always need to use the compiler flags from:

 GTK+-1.2: gtk-config --cflags
 GTK+-2.0: pkg-config --cflags gtk+-2.0

Once you do that, you can always use <gtk/gtk.h>. and have it work



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]