动态链接库找不到 : error while loading shared libraries: libgsl.so.0: cannot open shared object file: No such file or directory

问题:

运行gsl(GNU scientific Library)的函数库,用

gcc erf.c -I/usr/local/include -L/usr/local/lib64 -L/usr/local/lib -g -Wall --std=gnu99 -lgsl -lgslcblas -o m.o

编译,之后运行./m.o

提示error while loading shared libraries: libgsl.so.0: cannot open shared object file: No such file or directory

解决方法:

在shell下

ldd m.o

输出:

~/test/c $ldd m.o 
linux-vdso.so.1 => (0x00007fff3d5ff000) 
libgsl.so.0 => not found 
libgslcblas.so.0 => not found 
libc.so.6 => /lib64/libc.so.6 (0x00007f7420c3b000) 
/lib64/ld-linux-x86-64.so.2 (0x00007f7420fdd000)

说明libgsl和libgslcblas.so找不到

sudo ldconfig

ldconfig的作用是:Configure Dynamic Linker Run Time Bindings.

然后再次运行ldd m.o

~/test/c $ldd m.o 
linux-vdso.so.1 => (0x00007fff62bad000) 
libgsl.so.0 => /usr/local/lib/libgsl.so.0 (0x00007f6968a01000) 
libgslcblas.so.0 => /usr/local/lib/libgslcblas.so.0 (0x00007f69687ce000) 
libc.so.6 => /lib64/libc.so.6 (0x00007f6968439000) 
libm.so.6 => /lib64/libm.so.6 (0x00007f69681b5000)

已经成功运行

问题出现原因:

刚刚安装好gsl后,由于gsl的动态链接库没有及时刷新导致识别不到。

动态链接库找不到 : error while loading shared libraries: libgsl.so.0: cannot open shared object file: No such file or directory

时间: 2024-08-06 20:48:38

动态链接库找不到 : error while loading shared libraries: libgsl.so.0: cannot open shared object file: No such file or directory的相关文章

error while loading shared libraries: libpthread.so.0: cannot open shared object file: No such file

安装rac10g,出现如下错误: [[email protected] oracle]# /u01/product/crs/root.sh WARNING: directory '/u01/product' is not owned by root Checking to see if Oracle CRS stack is already configured /etc/oracle does not exist. Creating it now. Setting the permission

安装源码包inotify启动失败 error while loading shared libraries: libinotifytools.so.0: cannot open shared object fil

今天安装源码包inotify 一切安装妥当之后启动失败,报如下错误: 第一感觉是找不到这个库,此时有两种可能 1,操作系统上没有安装该库 2,操作系统找不到该库 首先在/usr路径下查找该包的名称,如下图 ps:为什么要在/usr下找呢,因为库文件一般都安装在该目录下. 结果只在源码包的安装路径下找到了该库,证明以源码包形式安装该软件的时候该库已经被安装在操作系统中了. 这就验证了上边的第2项,操作系统找不到该库的路径. 此时我们应该想怎么让操作系统找到该库 在这之前呢我们要先知道一点,程序里面

svnadmin:error while loading shared libraries: libaprutil-1.so.0:cannot open shared object file: No such file or directory

wdcp下安装svn后一直提示 解决办法 vi /etc/ld.so.conf 在文件的最后加入“/www/wdlinux/apache/lib”即可,然后更新下: ldconfig -v

Linux运行错误:error while loading shared libraries: xxx.so.0:cannot open shared object file: No such fil

链接时可以通过-L和-l来指定自己的库,因此链接可以通过,但是运行时,系统仍无法找到指定的库,需要简单配置一下. 解决方法1: 可以直接在将自己的库所在路径添加到/etc/ld.so.conf文件中.但一般这个文件中的内容都是一句"include /etc/ld.so.conf.d/*.conf",因此最好在/etc/ld.so.conf.d/目录下新建一个文件 , 如"xxx.conf",然后将自己的库所在路径添加到这个conf文件中. 修改完文件后,以root身

error while loading shared libraries: libmysqlclient.so.18: cannot open shared object file: No such

启动zabbix_server出现如题错误,差点没晕死过去,从前一直没出现,这种错误其实工作上已经遇到过无数次了,但是每次的没有好好记录总结一些,导致每次遇到都需要傻乎乎的跑到网上->百度,方可解决.今天特地针对这个小问题写一篇错误记录博客,日后遇到方可快速查看. 执行命令 cd /usr/local/mysql/lib/ ll libmysqlclient.so 发现有  libmysqlclient.so -> libmysqlclient.so.18 于是 ln -s /usr/loca

error while loading shared libraries: libpcre.so.0的解决办法(转)

error while loading shared libraries: libpcre.so.0的解决办法 昨晚刚买了台linux云服务器,今天配置apache2时,因没有备份libpcre.so.0文件便执行命令“rpm -e pcre –nodeps”,导致丢失libpcre.so.0文件.结果可想而知,新版的pcre再也安装不上了,apache2也无法再编译了.只要一编译,就提示错误: error while loading shared libraries: libpcre.so.0

NCARG安装配置出现error while loading shared libraries: libg2c.so.0问题额解决办法

nclncl: error while loading shared libraries: libg2c.so.0: cannot open shared object file: No such file or directory 先看看运行机器上面有没有这个动态链接库,有的话再看看环境变量对不对,libg2c.so.0 所在路径是不是在你的LD_LIBRARY_PATH里面了,可以到/etc/ld.so.conf文件里面去更改,然后ldconfig 如果有的话,按2楼操作,一般情况下是动态文

error while loading shared libraries: libpcre.so.0的解决办法

因没有备份libpcre.so.0文件便执行命令“rpm -e pcre –nodeps”,导致丢失libpcre.so.0文件.结果可想而知,新版的pcre再也安装不上了,apache2也无法再编译了.只要一编译,就提示错误: error while loading shared libraries: libpcre.so.0: cannot open shared object file: No such file or directory 经过半天的折腾,从别的服务器上拷贝来一份libpc

Nginx启动错误:error while loading shared libraries: libpcre.so.0

今天测试的时候,启动一个其他机器预编译好的nginx到目标测试机器(OEL 7.4)启动的时候,报了下列错误: /usr/local/nginx/sbin/nginx: error while loading shared libraries: libpcre.so.0: cannot open shared object file: No such file or directory 经查,OEL 7.4版本下/lib64下没有libpcre.so.0这个共享库,故创建一个到libpcre.s