error while loading shared libraries: libgdal.so.1 in archlinux

…衆ロ難τιáo~ 提交于 2019-12-07 13:00:07

问题


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

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

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

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

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

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

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/

But /sbin/ldconfig -p | grep gdal still shows:

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

回答1:


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

after that, run /sbin/ldconfig



来源:https://stackoverflow.com/questions/32806621/error-while-loading-shared-libraries-libgdal-so-1-in-archlinux

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!