如何解决旧的 GLIB 错误

Hak*_*rie 5 gtk environment-variables glib

我正在安装 GTK+,但它需要各种先决条件。这些是

  • glib - 2.0 >= 2.35.3
  • 攻击力 - >= 2.7.5
  • 盘古->= 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.
Run Code Online (Sandbox Code Playgroud)

在过去的几个小时里,我一直在兜兜转转,试图让这个工作,如果有人能提供帮助,我将不胜感激。提前致谢

小智 3

我和你有同样的问题。

我设置PKG_CONFIG_PATHLD_LIBRARY_PATH作为

PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
LD_LIBRARY_PATH=/usr/local/lib
Run Code Online (Sandbox Code Playgroud)

请参阅/sf/ask/785972141/

但这没有用。然后我发现有人解决了这个问题

echo $LD_LIBRARY_PATH
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
Run Code Online (Sandbox Code Playgroud)

请参阅http://www.linuxquestions.org/questions/linux-software-2/how-to-set-ld_library_path-pkg_config_path-and-glib_config-937732/

它确实有效!


小智 0

我测试了很多次,并且我验证了如果我们从源代码安装 glib,我们必须选择:

  1. 如果使用 do ./configure --prefix=/usr --with-pcre=system,如说明中所示,则意味着我们已将 glib 安装在/usr/lib path. 所以,我们需要制作export LD_LIBRARY_PATH=/usr/lib.
  2. 如果我们不使用--prefix=默认路径是/usr/local/lib/. 因此,如果pkg_config发现安装了两个库,我们需要export LD_LIBRARY_PATH=/usr/local/lib在默认路径中安装。

希望它能帮助某人。