GTK2+ on Ubuntu

Started by
1 comment, last by 255 19 years, 1 month ago
I'm using Anjuta as a IDE, and when I try to include the gtk/gtk.h file it gives me alot of error that he cant find the include files. now I tried to copy all the directories from /usr/include/gtk-2.0 to /usr/include/ but it only game me alot of other diffrent errors... anyone is using GTK on ubuntu? please?
How appropriate, you fight like a cow!
Advertisement
gcc doesn't look into /usr/include/gtk-2.0 for header files by default, so you have to tell gcc where to find the headers. You can do this by adding -I/usr/include/gtk-2.0 to the compiler flags


"THE INFORMATION CONTAINED IN THIS REPORT IS CLASSIFIED; DO NOT GO TO FOX NEWS TO READ OR OBTAIN A COPY." , the pentagon
I think you should use pkg-config.

Add this to the compiler flags:
`pkg-config --cflags gtk+-2.0`
to get the includes and this to the linker flags:
`pkg-config --libs gtk+-2.0`
to get the flags to link to gtk2.

If there is only one place to put both of these, you can use
`pkg-config --cflags --libs gtk+-2.0`

Note that the backticks (``) are not apostrophes ('').

You should also read man pkg-config and run echo `pkg-config --cflags --libs gtk+-2.0` to see and understand how it works and why it is so useful.

This topic is closed to new replies.

Advertisement