GTK2+ on Ubuntu

This topic is 4904 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

Recommended Posts

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?

Share on other sites
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

Share on other sites
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.

1. 1
2. 2
3. 3
4. 4
frob
15
5. 5

• 16
• 12
• 20
• 12
• 13
• Forum Statistics

• Total Topics
632155
• Total Posts
3004473

×