Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GTK+ installation

Tags:

linux

gtk

I am using ubuntu 12.10. I have CODE:Blocks IDE. I want to use gtk+ but when i create a project and build it it says it cannot find gtk.h file.

I downloaded gtk+, glib, pango, gdk-pixbuf and atk by writing

git clone git://git.gnome.org/gtk+, 
git clone git://git.gnome.org/glib

...

then i unzipped all libraries. every thing was fine unti here.

To install gtk+ i write "./configure --prefix=/opt/gtk" it starts processing, most of the process goes OK, but then it comes with an error

...
checking for some Win32 platform... no
checking whether build environment is sane... yes
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for BASE_DEPENDENCIES... no
configure: error: Package requirements (glib-2.0 >= 2.33.1    atk >= 2.5.3    pango >= 1.30.0    cairo >= 1.10.0    cairo-gobject >= 1.10.0    gdk-pixbuf-2.0 >= 2.26.0) were not met:
No package 'glib-2.0' found
No package 'atk' found
No package 'pango' found
No package 'cairo' found
No package 'cairo-gobject' found
No package 'gdk-pixbuf-2.0' found
Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.
Alternatively, you may set the environment variables BASE_DEPENDENCIES_CFLAGS
and BASE_DEPENDENCIES_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.

I tried to install other libraries by writing ./configure in their directory. But it could not file configure file.

I set PKG_CONFIG_PATH but it does not work anyway

How can I install it?

like image 447
halilenver Avatar asked Jan 28 '13 10:01

halilenver


2 Answers

You should use : apt-get install libgtk2.0-dev

like image 191
Eddie Avatar answered Oct 26 '22 23:10

Eddie


You don't need the git clone step. This would be required only if you wanted to rebuild GTK+.

What you want is the development packages of your Linux distro. Search in your packages for something like libgtk*-dev, and install it. This will install the headers you need and all the dependencies required. Furthermore, pkg-config won't require any hint to find the .pc files that describe how to build and link applications against those libraries, so no need for configuring PKG_CONFIG_PATH.

like image 35
liberforce Avatar answered Oct 27 '22 00:10

liberforce