Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I wanted to install gtk+ 2.16.5, so i also installed glib, pango and cairo. All seemed to work well, except for cairo.

At first I got an error while configuring:

Requested 'cairo >= 1.6' but version of cairo is 1.4.12

I installed the newest version of cairo without any problems, i rebooted the comp and when i started the configure again the same thing happened and it showed me the same error.

I also can see this:

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.

Can someone help me ? Thanks.

share|improve this question
add comment

3 Answers

What do you mean by "I installed the newest version of cairo without any problems".

Did you install a slackware package or did you untar a pre-built archive or did you compile it from source?

I suspect that you did either one of the latter. If you merely downloaded a archive and untarred it somewhere, the package manger would not know. Ditto with source based compile and installs.

It is more difficult to mix source and package managed software. If there is no reason for you to use the 'latest' gtk+, just use the one that was pre-packaged. Now that slackware 13 is out, you can even check to see if it has the latest gtk+ and upgrade to that one instead.

share|improve this answer
add comment

You don't mention any details about how did you install cairo. If you installed it from source the usual way: configure; make; make install, then it went to /usr/local, but Slackware uses --prefix=/usr. That might be the reason, but this is simply ans assumption.

share|improve this answer
add comment

Here is script that I use to compile gtk+ on slackware:

#!/bin/bash
INSTALL_DIR=/opt/gtk

GLIB_VER=2.21.1
ATK_VER=1.26.0
CAIRO_VER=1.8.6
PANGO_VER=1.24.2
GTK_VER=2.17.1
GOOCANVAS_VER=0.15

mkdir -p ${INSTALL_DIR}

CPPFLAGS="-I${INSTALL_DIR}/usr/include"
LDFLAGS="-L${INSTALL_DIR}/usr/lib"
PKG_CONFIG_PATH="${INSTALL_DIR}/usr/lib/pkgconfig"
LD_LIBRARY_PATH="${INSTALL_DIR}/usr/lib"
PATH="${INSTALL_DIR}/usr/bin:$PATH"
export CPPFLAGS LDFLAGS PKG_CONFIG_PATH LD_LIBRARY_PATH PATH

#glib
tar zxvf glib-${GLIB_VER}.tar.gz
cd glib-${GLIB_VER}
./configure --prefix=${INSTALL_DIR}/usr --sysconfdir=${INSTALL_DIR}/etc && make && make install
cd ..

#atk
tar zxvf atk-${ATK_VER}.tar.gz
cd atk-${ATK_VER}
./configure --prefix=${INSTALL_DIR}/usr --sysconfdir=${INSTALL_DIR}/etc && make && make install
cd ..

#cairo
tar zxvf cairo-${CAIRO_VER}.tar.gz
cd cairo-${CAIRO_VER}
./configure --prefix=${INSTALL_DIR}/usr --sysconfdir=${INSTALL_DIR}/etc && make && make install
cd ..

#pango
tar zxvf pango-${PANGO_VER}.tar.gz
cd pango-${PANGO_VER}
./configure --prefix=${INSTALL_DIR}/usr --sysconfdir=${INSTALL_DIR}/etc && make && make install
cd ..

#gtk
tar zxvf gtk+-${GTK_VER}.tar.gz
cd gtk+-${GTK_VER}
./configure --prefix=${INSTALL_DIR}/usr --sysconfdir=${INSTALL_DIR}/etc && make && make install
cd ..

Put this script and needed files in same dir. For gtk 2.17.1 needed files are:

glib-2.21.1.tar.gz
atk-1.26.0.tar.gz
cairo-1.8.6.tar.gz
pango-1.24.2.tar.gz
gtk+-2.17.1.tar.gz

You must compile this in this order if you want it to work. Also, new gtk version will be installed in /opt/gtk so it doesn't bother gtk installed by default.

If you want to compile (and run) program which uses new gtk, you simply need to put this in your /home/user/.bashrc file:

INSTALL_DIR=/opt/gtk

PKG_CONFIG_PATH="${INSTALL_DIR}/usr/lib/pkgconfig"
LD_LIBRARY_PATH="${INSTALL_DIR}/usr/lib"
PATH="${INSTALL_DIR}/usr/bin:$PATH"
export PKG_CONFIG_PATH LD_LIBRARY_PATH PATH

and that's it.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.