gm: error while loading shared libraries: libpng15.so.15: cannot open shared object file: No such file or directory
安装gm库产生问题
解决方案:
# cat /etc/ld.so.conf
include ld.so.conf.d/*.conf
# echo "/usr/local/lib" >> /etc/ld.so.conf
# ldconfig
一般我们在Linux下执行某些外部程序的时候可能会提示找不到共享库的错误, 比如:
tmux: error while loading shared libraries: libevent-1.4.so.2: cannot open shared object file: No such file or directory
原因一般有两个, 一个是操作系统里确实没有包含该共享库(lib*.so.*文件)或者共享库版本不对, 遇到这种情况那就去网上下载并安装上即可.
另外一个原因就是已经安装了该共享库, 但执行需要调用该共享库的程序的时候, 程序按照默认共享库路径找不到该共享库文件.
所以安装共享库后要注意共享库路径设置问题, 如下:
1) 如果共享库文件安装到了/lib或/usr/lib目录下, 那么需执行一下ldconfig命令
ldconfig命令的用途, 主要是在默认搜寻目录(/lib和/usr/lib)以及动态库配置文件/etc/ld.so.conf内所列的目录下, 搜索出可共享的动态链接库(格式如lib*.so*), 进而创建出动态装入程序(ld.so)所需的连接和缓存文件. 缓存文件默认为/etc/ld.so.cache, 此文件保存已排好序的动态链接库名字列表.
2) 如果共享库文件安装到了/usr/local/lib(很多开源的共享库都会安装到该目录下)或其它"非/lib或/usr/lib"目录下, 那么在执行ldconfig命令前, 还要把新共享库目录加入到共享库配置文件/etc/ld.so.conf中, 如下:
# cat /etc/ld.so.conf
include ld.so.conf.d/*.conf
# echo "/usr/local/lib" >> /etc/ld.so.conf
# ldconfig
3) 如果共享库文件安装到了其它"非/lib或/usr/lib" 目录下, 但是又不想在/etc/ld.so.conf中加路径(或者是没有权限加路径). 那可以export一个全局变量LD_LIBRARY_PATH, 然后运行程序的时候就会去这个目录中找共享库.
LD_LIBRARY_PATH的意思是告诉loader在哪些目录中可以找到共享库. 可以设置多个搜索目录, 这些目录之间用冒号分隔开.
比如安装了一个mysql到/usr/local/mysql目录下, 其中有一大堆库文件在/usr/local/mysql/lib下面,
则可以在.bashrc或.bash_profile或shell里加入以下语句即可:
export LD_LIBRARY_PATH=/usr/local/mysql/lib:$LD_LIBRARY_PATH
一般来讲这只是一种临时的解决方案, 在没有权限或临时需要的时候使用.
4)如果程序需要的库文件比系统目前存在的村文件版本低,可以做一个链接 比如: error while loading shared libraries: libncurses.so.4: cannot open shared
object file: No such file or directory
ls /usr/lib/libncu*
/usr/lib/libncurses.a /usr/lib/libncurses.so.5
/usr/lib/libncurses.so /usr/lib/libncurses.so.5.3
可见虽然没有libncurses.so.4,但有libncurses.so.5,是可以向下兼容的 建一个链接就好了 ln -s /usr/lib/libncurses.so.5.3 /usr/lib/libncurses.so.4
gm: error while loading shared libraries: libpng15.so.15: cannot open shared object file: No such file or directory的更多相关文章
- 转 error while loading shared libraries: libmysqlclient.so.15: cannot open shared object file
我是今天再用emboss得时候发现出现问题了,再网上搜索了一下,发现有人和我一样得问题,解决得方法是: wget -O /usr/lib64/libmysqlclient.so.15 http://f ...
- 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 ...
- error while loading shared libraries: libmysqlclient.so.18: cannot open shared object file: No such file or directory
zabbix3.2启动有如下报错: # service zabbix_server startStarting zabbix_server: /home/zabbix-server/sbin/zab ...
- 错误解决:error while loading shared libraries: libcurl.so.4: cannot open shared object file: No such file or directory
执行以下代码,生成唯一的UID $fp = popen("/xxx/bin/tools/uuidgen system", "r");// $uid = frea ...
- error while loading shared libraries: libXXX.so.x: cannot open shared object file: No such file or directory .
转载:http://www.eefocus.com/pengwr/blog/2012-02/235057_baf52.html 此时你可以locate libXXX.so.x 一下,查看系统里是否有该 ...
- Ubuntu12.04安装64位系统出现编译错误error while loading shared libraries: libz.so.1: cannot open shared object file: No such file or dir
问题: Ubuntu12.04安装64位系统出现编译错误error while loading shared libraries: libz.so.1: cannot open shared obje ...
- 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 ...
- 动态链接库找不到 : 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/loc ...
- ./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 ...
随机推荐
- 约瑟夫环形链表问题、丢手帕问题、剑指offer圆圈中最后一个数问题
public class Solution { // 左神解法,本题本质还是报数为m-1的倍数的人死.求最后一个活着的人是初始时候的哪个人 /* 报数(A) 实际人员编号(B) ...
- java 注解(自身理解)
声明注解 使用注解 解析注解 产生的结果 注解利用的是反射机制 ============================================================= 使用注解修饰 ...
- 两名技术人员,历经8小时Piranha Games成功集成Xsolla
w=580&h=304" alt="" width="580" height="304" style="max- ...
- struts 在Action中访问web元素(request,session等)
出发jsp: <?xml version="1.0" encoding="GB18030" ?> <%@ page language=&quo ...
- jrebel 7免费激活(非破解) 和 IntelliJ Idea 2017 免费激活方法
转自http://www.cnblogs.com/suiyueqiannian/p/6734412.html http://www.cnblogs.com/suiyueqiannian/p/67540 ...
- 编译的时候找不到包 但是maven denpendencies已经有这个包 。或者myeclipse 为webroot eclipse为webContext需要修改
在Eclipse中生成项目是WebContent目录 而在MyEclipse中生成的项目目录名字好像叫做WebRoot,那么如果把MyEclipse的项目导入到Eclipse中,如果要部署项目到Tom ...
- 插入排序(PHP,C)
PHP<?php /* ** 功能:插入算法 ** 描述: ** 作者:yuwensong */ function insertSorting($arr,$n){ for($i = 1; $i& ...
- (C#)Windows Shell 外壳编程系列1 - 基础,浏览一个文件夹
1 - 基础,浏览一个文件夹 我们知道,在win32中是以外壳名字空间的形式来组织文件系统的,在外壳名字空间里的每一个对象(注)都实现了一个IShellFolder的接口,通过这个接口我们可以直接查询 ...
- 开源框架AsyncHttpClient使用
开源框架AsyncHttpClient使用 2013-10-14 15:16:35 分类: Android平台 在大神岩岩的推荐下使用了AsyncHttpClient框架,用过之后感觉还是灰常好用滴. ...
- 【HTML+CSS】(2)CSS Sprite雪碧图
1. 雪碧图的使用场景 (1). 静态图片.不随用户信息的变化而变化 (2). 小图片.图片容量比較小 (3). 载入量比較大 一些大图不建议拼成雪碧图,比如淘宝站点的导航图片都是使用的雪碧图. 2. ...