Linux 如何找到旧版本 GLIB 的安装位置?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/11228173/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to find where older version of GLIB has been installed?
提问by mihajlv
I am trying to install atk-2.4.0and I get the error:
我正在尝试安装atk-2.4.0,但出现错误:
'pkg-config --modversion glib-2.0' returned 2.32.3, but GLIB (2.26.1)
*** was found!
I also tried updating PKG_CONFIG_PATHto include the path of glib-2.0.pcbut still same error appears. Could anyone help me how to find where 2.26.1 was installed I am relatively new to Ununtu? Thanks.
我也尝试更新PKG_CONFIG_PATH以包含路径,glib-2.0.pc但仍然出现相同的错误。谁能帮我找到 2.26.1 的安装位置 我对 Ununtu 比较陌生?谢谢。
采纳答案by another.anon.coward
Posting comments as response:
From find /usr/ -iname "*glib*.pc"it is found that there .pcfile related to glibis available in /usr/lib/pkgconfig& /usr/local/lib/pkgconfig. Checking the system package management it appears that version 2.26.1is installed from the repositories. The path for installation of glibfrom repositories is generally/usr/lib(This may vary a bit in case of 64 bit systems wherein there are different folders for 32 bit & 64 bit libraries). Thus it appears that glibalso has been installed from source (guessing by installation path /usr/local/lib) which of version 2.32.2. If you need version 2.32.2set PKG_CONFIG_PATHto /usr/local/lib/pkgconfig& LD_LIBRARY_PATHto /usr/local/lib/
Hope this helps!
发表评论作为回应:
从中find /usr/ -iname "*glib*.pc"发现.pc与 相关的文件glib在/usr/lib/pkgconfig& 中可用/usr/local/lib/pkgconfig。检查系统包管理,似乎版本2.26.1是从存储库安装的。glib从存储库安装的路径通常是/usr/lib(在 64 位系统的情况下可能会有所不同,其中 32 位和 64 位库有不同的文件夹)。因此,似乎glib也已从源(通过安装路径猜测/usr/local/lib)哪个版本安装了2.32.2. 如果您需要将版本2.32.2设置PKG_CONFIG_PATH为/usr/local/lib/pkgconfig&
希望这会LD_LIBRARY_PATH有所/usr/local/lib/
帮助!
回答by Szilárd Pfeiffer
You have to synchronize you PKG_CONFIG_PATHand LD_LIBRARY_PATHenvironment variables. Assuming that your prefix is /usr/localthe followings should be set:
您必须同步您PKG_CONFIG_PATH和LD_LIBRARY_PATH环境变量。假设您的前缀是/usr/local以下应设置:
PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
LD_LIBRARY_PATH=/usr/local/lib
You may also need to set other variables to compile glib dependent softwares:
您可能还需要设置其他变量来编译 glib 相关软件:
ACLOCAL_PATH=/usr/local/share/aclocal/
PATH=/usr/local/bin:$PATH

