加载中…
个人资料
  • 博客等级:
  • 博客积分:
  • 博客访问:
  • 关注人气:
  • 获赠金笔:0支
  • 赠出金笔:0支
  • 荣誉徽章:
正文 字体大小:

解决cannot open shared object file: No such file or&nbsp

(2013-01-21 21:37:06)
标签:

it

分类: coding

C语言程序调用 GSL 的 libgsl.so 时出现的一个错误,过程如下:


1
2
3
4
5
6
7
8
9
10

#include  

#include 
  

int main() 

{ 

     double x = 5.0; 

     double y = gsl_sf_bessel_J0(x);

      printf("J0(%g) = %.18e\n", x, y);

      return 0; 

}

首先编译 example.c 

$ gcc -Wall example.c -lgsl -lgslcblas -lm -o example

编译通过,运行:

$ ./example

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

报错。

解决方法是:

$ sudo ldconfig /usr/local/lib

$ example

J0(5) = -1.775967713143382920e-01

WP-CODEBOX

声明:文章未经说明都是原创,转载请注明: 转载自XiFage's Blog

本文链接地址: http://xifage.com/cannot-open-shared-object-file-no-such-file-or-directory/

0

阅读 收藏 喜欢 打印举报/Report
  

新浪BLOG意见反馈留言板 欢迎批评指正

新浪简介 | About Sina | 广告服务 | 联系我们 | 招聘信息 | 网站律师 | SINA English | 产品答疑

新浪公司 版权所有