Jack
Jack

Reputation: 16724

Compiling gtk from sources

I'm tring to compile gtk+-3.2.0 but I get an error message from ./configure:

checking for GLIB - version >= 2.29.14... 
*** 'pkg-config --modversion glib-2.0' returned 2.32.4, but GLIB (2.34.0)
*** was found! If pkg-config was correct, then it is best
*** to remove the old version of GLib. You may also be able to fix the error
*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing
*** /etc/ld.so.conf. Make sure you have run ldconfig if that is
*** required on your system.
*** If pkg-config was wrong, set the environment variable PKG_CONFIG_PATH
*** to point to the correct configuration files
no
configure: error: 
*** GLIB 2.29.14 or better is required. The latest version of
*** GLIB is always available from ftp://ftp.gtk.org/pub/gtk/.

I really have GLIB 2.34.0 (which I have compiled from sources too) but I don't know how to do gtk know the library. I have changed PKG_CONFIG_PATH to points to path where is the new glib installation and after a ldconfig but makes no difference. by modifing /etc/ld.so.conf I really have no idea how to do.

Upvotes: 2

Views: 1241

Answers (1)

liberforce
liberforce

Reputation: 11454

PKG_CONFIG_PATH should contain the path to the directory where the .pc file for the GLib version you want to use is.

Otherwise, use your package manager to detect which package has installed the .pc file that you don't want to use. And remove that package. For example, on an rpm-based distro, run:

strace -eopen pkg-config --modversion glib-2.0 2>&1 | grep "\.pc"

It will return where is located the .pc file detected by pkg-config.

open("/usr/lib64/pkgconfig/glib-2.0.pc", O_RDONLY) = 3

Then detect to which package this file belongs:

rpm -qf /usr/lib64/pkgconfig/glib-2.0.pc

Here's the result on my Mageia 2 system:

lib64glib2.0-devel-2.32.4-1.1.mga2

Removing this package will remove the .pc that gets in the way. However, you should prefer the PKG_CONFIG_PATH method in the case removing the package also tries to remove other dependencies you still want to use.

Upvotes: 1

Related Questions