问题:

运行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的更多相关文章

  1. nginx检查报错 error while loading shared libraries: libprofiler.so.0: cannot open shared object file: No such file or directory

    在centos7.3上编译安装nginx-1.12.2 启动测试出错 [root@web02 local]# /usr/local/nginx/sbin/nginx -t /usr/local/ngi ...

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

    wdcp下安装svn后一直提示 svnadmin:error while loading shared libraries: libaprutil-1.so.0:cannot open shared ...

  3. ./filezilla: error while loading shared libraries: libpng12.so.0: cannot open shared object file: No such file or directory

    opensuse系统 在filezilla官网下载压缩文件解压运行后报 ./filezilla: error while loading shared libraries: libpng12.so.0 ...

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

    安装rac10g,出现例如以下错误: [root@rac2 oracle]# /u01/product/crs/root.sh WARNING: directory '/u01/product' is ...

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

    链接时可以通过-L和-l来指定自己的库,因此链接可以通过,但是运行时,系统仍无法找到指定的库,需要简单配置一下. 解决方法: 可以直接在将自己的库所在路径添加到/etc/ld.so.conf文件中.但 ...

  6. opensuse13.1 安装chrome报 error while loading shared libraries:libudev.so.0:cannot open shared object file:no file or directory

    1  opensuse13.1 安装chrome时 先用rpm -ivh --test **.rpm 测试安装  安装上缺少的文件 2 但是安装测试通过 却不能启动 原因 缺少一个文件 libudev ...

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

    error while loading shared libraries: libpcre.so.0的解决办法 http://blog.csdn.net/xjkwq1qq/article/detail ...

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

    今天测试的时候,启动一个其他机器预编译好的nginx到目标测试机器(OEL 7.4)启动的时候,报了下列错误: /usr/local/nginx/sbin/nginx: error while loa ...

  9. gm: error while loading shared libraries: libpng15.so.15: cannot open shared object file: No such file or directory

    安装gm库产生问题 解决方案: # cat /etc/ld.so.confinclude ld.so.conf.d/*.conf# echo "/usr/local/lib" &g ...

随机推荐

  1. android学习日记27--Dialog使用及其设计模式

    1.Dialog概述 对话框一般是一个出现在当前Activity之上的一个小窗口,处于下面的Activity失去焦点, 对话框接受所有的用户交互. 对话框一般用于提示信息和与当前应用程序直接相关的小功 ...

  2. perl dtrace2

    http://search.cpan.org/~chrisa/Devel-DTrace-Provider-1.11/lib/Devel/DTrace/Provider.pm

  3. C#_delegate - 调用列表

    using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace Dele ...

  4. ADT在线安装

    以往安装ADT根本就不是个问题,可是现在就是个大问题了,联通的宽带网络连www.google.com.hk都打不开,你叫我们这些P民怎么活? https://dl-ssl.google.com/and ...

  5. objc_msgSend消息传递学习笔记 – 对象方法消息传递流程

    在Effective Objective-C 2.0 – 52 Specific Ways to Improve Your iOS and OS X Programs一书中,tip 11主要讲述了Ob ...

  6. iOS 开发中使用 NSURLProtocol 拦截 HTTP 请求

    这篇文章会提供一种在 Cocoa 层拦截所有 HTTP 请求的方法,其实标题已经说明了拦截 HTTP 请求需要的了解的就是 NSURLProtocol. 由于文章的内容较长,会分成两部分,这篇文章介绍 ...

  7. jsp HTTP Status 405 - HTTP method GET is not supported by this URL

    package myservlet.control; import java.io.IOException; import java.io.PrintWriter; import javax.serv ...

  8. ios 界面间跳转方法总结

    接触ios也有一段时间了,偶然间,我们公司的技术总监兼我的导师,问我,你可知道,界面间的跳转有几种方式?我说出了两种,但是也有点含糊其辞,于是我就想一定要找个时间总结一下.有句话说的好,“前人种树,后 ...

  9. c++ 拷贝构造练习

    #include<iostream> using namespace std; class Vector { private: int *dwp; int size; void clone ...

  10. Pyhont 网络编程【第一篇】初始Socket网络套接字

    一.什么是socket: Socket 别名 “网络套接字”,指网络通信链句柄 其实就是一堆网络信息(ip+端口) 建立起的链接称之为socket,Socket的英文原义是“孔”或“插座”,用来实现不 ...