2

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.

6
  • Okay, so I think you have to remove an old version of GLib? Commented Nov 24, 2012 at 17:47
  • But it will not broke another source codes? Commented Nov 24, 2012 at 17:50
  • By removing older glib version can makes source code that use such version non-compilable Commented Nov 24, 2012 at 18:24
  • Probably not, as glib is quite backwards-compatible (especially with minor versions) Commented Nov 24, 2012 at 18:27
  • it depends how you installed it Commented Nov 24, 2012 at 18:43

1 Answer 1

1

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.

Sign up to request clarification or add additional context in comments.

4 Comments

Thanks very much. I have fixed it yesterday,but I've forget to notice this here. Also, what the version shall 'pkg-config --modversion gtk+-3.0` returns? I'm getting 3.2.1 and gtk-demo works fine, but when I try to compile some program I get
/usr/lib/libgtk-3.so: undefined reference to gdk_broadway_window_get_type' /usr/lib/libgtk-3.so: undefined reference to gdk_x11_device_manager_xi_get_type' /usr/lib/libgtk-3.so: undefined reference to gdk_broadway_get_last_seen_time' /usr/lib/libgtk-3.so: undefined reference to gdk_extension_mode_get_type' /usr/lib/libgtk-3.so: undefined reference to gdk_x11_device_xi_get_type'`
Fixed it installing gtk 3.0.0. Thanks very much again. Just another problem: some widgets aren't well drawd; I get errors like Theme parsing error: gtk-widgets.css: 817:65: Could not recognize the image file format how to fix it?
Give a look at that file, and check at line 817 which file format it is trying to open. Then check you have a gdk-pixbuf loader for that file format.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.