我正在安装 GTK+,但它需要各种先决条件。这些是
- glib——2.0 >= 2.35.3
- atk — >= 2.7.5
- Pango- >= 1.32.4
- gdk-pixbuf-2.0 >= 2.27.1
现在我将 glib-2.0 升级到 2.38.2,并且尝试升级 atk、pango 和 gdk-pixbuf
checking for GLIB - version >= 2.31.2...
'pkg-config --modversion glib-2.0' returned 2.38.2, but GLIB (2.32.4)
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
configure: error:
GLIB 2.31.2 or better is required. The latest version of
GLIB is always available from ftp://ftp.gtk.org/. If GLIB is installed
but not in the same location as pkg-config add the location of the file
glib-2.0.pc to the environment variable PKG_CONFIG_PATH.
过去几个小时我一直在努力让它工作,如果有人能帮忙的话我将不胜感激。提前致谢
答案1
我和你有同样的问题。
我设定PKG_CONFIG_PATH
为LD_LIBRARY_PATH
PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
LD_LIBRARY_PATH=/usr/local/lib
但它不起作用。后来我发现有人解决了这个问题
echo $LD_LIBRARY_PATH
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
而且它确实有效!
答案2
我测试了很多次,并验证了如果我们从源代码安装 glib,我们有以下选项:
- 如果使用 do
./configure --prefix=/usr --with-pcre=system
,例如指示,说明我们已经在 中安装了 glib/usr/lib path
。因此,我们需要 makeexport LD_LIBRARY_PATH=/usr/lib
。 - 如果我们不使用
--prefix=
默认路径,则为/usr/local/lib/
。因此,如果pkg_config
发现安装了两个库,我们需要确保export LD_LIBRARY_PATH=/usr/local/lib
它们安装在默认路径中。
希望它能对某人有所帮助。