./a.out: error while loading shared libraries: libgsl.so.25: cannot open shared object file: No such file or directory

发布时间 2023-10-10 22:58:40作者: 小鲨鱼2018

 

001、问题: ./a.out: error while loading shared libraries: libgsl.so.25: cannot open shared object file: No such file or directory

 

002、解决方法

[root@pc1 test]# ls
a.c
[root@pc1 test]# gcc -I/usr/local/include/gsl -lgsl -lgslcblas a.c
[root@pc1 test]# ls
a.c  a.out
[root@pc1 test]# ./a.out
./a.out: error while loading shared libraries: libgsl.so.25: cannot open shared object file: No such file or directory
[root@pc1 test]#
[root@pc1 test]# echo "/usr/local/lib" >> /etc/ld.so.conf       ## 修改配置文件
[root@pc1 test]# ldconfig                                       ## 更新配置文件
[root@pc1 test]# ./a.out
Segmentation fault (core dumped)

 

 

参考:

https://blog.csdn.net/qq_36748248/article/details/110672626