加载共享库时出错:archlinux中的libgdal.so.1 [英] error while loading shared libraries: libgdal.so.1 in archlinux

查看:328
本文介绍了加载共享库时出错:archlinux中的libgdal.so.1的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Archlinux中启动脚本时,我(我自己是编程新手)收到以下错误消息:

I (myself a programm novice) get the following error message when starting a script in archlinux, which has been written by a friend:

/usr/bin/psxy: error while loading shared libraries: libgdal.so.1: cannot open shared object file: No such file or directory
/usr/bin/psbasemap: error while loading shared libraries: libgdal.so.1: cannot open shared object file: No such file or directory
/usr/bin/ps2raster: error while loading shared libraries: libgdal.so.1: cannot open shared object file: No such file or directory
/usr/bin/psxy: error while loading shared libraries: libgdal.so.1: cannot open shared object file: No such file or directory

此时,脚本使用通用映射工具(GMT).我认为该问题是链接程序问题,并且与gdal有关.安装的版本是:

At that point in the script it uses the Generic Mapping Tools (GMT). I think the problem is a linker problem and related to gdal. The version installed is:

gdalinfo --version
GDAL 2.0.0, released 2015/06/14

并且确实没有安装libgdal.so.1(或已将其重命名为/usr/lib/libgdal.so?):

And, indeed, libgdal.so.1 is not installed (or has been renamed to /usr/lib/libgdal.so?):

/sbin/ldconfig -p | grep gdal
    libgdal.so.20 (libc6,x86-64) => /usr/lib/libgdal.so.20
    libgdal.so (libc6,x86-64) => /usr/lib/libgdal.so

但是当我想安装gdal1时,就会与已经安装的gdal(我认为是2.0)发生冲突.

But when I want to install gdal1, then it comes to a conflict with the already installed gdal (which I presume is 2.0).

我该怎么办?我是否必须编辑脚本,如果需要,请在何处使用gdal?

What can I do? Do I have to edit the script and if so, where, to make it use of gdal?

在执行脚本之前,我输入LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib并出现与上面相同的错误消息.

I enter LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib before executing the script with the same error message as above.

然后,我尝试通过locate libgdal编辑ldconfig文件:

I have, then, tried to edit the ldconfig file by locate libgdal:

/usr/lib/libgdal.so
/usr/lib/libgdal.so.20
/usr/lib/libgdal.so.20.0.0

nano /etc/ld.so.conf -> adding /usr/lib/

但是/sbin/ldconfig -p | grep gdal仍然显示:

libgdal.so.20 (libc6,x86-64) => /usr/lib/libgdal.so.20
libgdal.so (libc6,x86-64) => /usr/lib/libgdal.so

推荐答案

您可以建立指向该库的符号链接,以便您的应用程序可以找到它:

You can make a symbolic links to that library so your application can find it:

ln -s /usr/lib/libgdal.so /usr/lib/libgdal.so.1

然后,运行/sbin/ldconfig

这篇关于加载共享库时出错:archlinux中的libgdal.so.1的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆