错误解决error while loading shared libraries: libXXX.so.X: cannot open shared object file: No such file
转自:http://blog.csdn.net/david_xtd/article/details/7625626
前提:ubuntu-debug机器上向SVN提交了pdu-IVT,想在别的普通机器上验证直接make能否成功,编译出的用户程序能否运行。
工作PC机上装有VMware,里面的ubuntu版本跟ubuntu-debug机器上相同,都是ubuntu 11.10版本。
VMware的家目录下有个目录pdu-IVT,是从SVN上更新出来之后,直接拷贝过来的。
在将ubuntu-debug机器上,make能成功,并且生成的二进制可执行程序pdu也能运行,并与switch成功建立连接;
但在工作PC机的VMware中,运行make时,提示错误:
- /usr/bin/ld: cannot find -lCiscoEnergyWiseSdk
- collect2: ld returned 1 exit status
- make: *** [pdu] Error 1
分析原因:ld提示找不到库文件,而库文件就在当前目录中。
链接器ld默认的目录是/lib和/usr/lib,如果放在其他路径也可以,需要让ld知道库文件在哪里。
方法1:
编辑/etc/ld.so.conf文件,在新的一行中加入库文件所在目录;
运行ldconfig,以更新/etc/ld.so.cache文件;
方法2:
在/etc/ld.so.conf.d/目录下新建任何以.conf为后缀的文件,在该文件中加入库文件所在的目录;
运行ldconfig,以更新/etc/ld.so.cache文件;
本人觉得第二种办法更为方便,对于原系统的改动最小。因为/etc/ld.so.conf文件的内容是include /etc/ld.so.conf.d/*.conf
所以,在/etc/ld.so.conf.d/目录下加入的任何以.conf为后缀的文件都能被识别到。
- 本人的作法:
- 1. 将所有的用户需要用到的库放到/usr/loca/lib;
- 2. 在/etc/ld.so.conf.d/目录下新建文件usr-libs.conf,内容是:/usr/local/lib
- 3. #sudo ldconfig
ld.so.cache的更新是递增式的,就像PATH系统环境变量一样,不是从头重新建立,而是向上累加。
除非重新开机,才是从零开始建立ld.so.cache文件。
错误解决error while loading shared libraries: libXXX.so.X: cannot open shared object file: No such file的更多相关文章
- 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 一下,查看系统里是否有该 ...
- 解决error while loading shared libraries: libXXX.so.X: cannot open shared object file: No such file
原文地址:http://blog.csdn.net/yjk13703623757/article/details/53217377 一.问题 运行hydra时,提示错误: hydra : error ...
- 错误解决: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: libgd.so.2: cannot open shared object错误
解决软件启动报error while loading shared libraries: libgd.so.2: cannot open shared object错误 今天安装启动nginx的时候报 ...
- 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 ...
- Atlas系列一:【已解决】error while loading shared libraries: libcrypto.so.6: cannot open shared object file: No such file or directory
1:Atlas的安装 https://github.com/Qihoo360/Atlas/wiki/Atlas的安装 2: [root@localhost bin]# ./mysql-proxyd t ...
- MYSQL之 error while loading shared libraries: libtinfo.so.5: cannot open shared objectfile: No such f
环境:ubuntu18 登陆MYSQL时遇到错误:mysql: error while loading shared libraries: libtinfo.so.5: cannot open sha ...
- 报错libtest: error while loading shared libraries: libuv.so.1: cannot open shared object file: No such file or directory
使用g++编译.运行libuv的demo错误解决 我们通过例子来讲述监视器的使用. 例子中空转监视器回调函数被不断地重复调用, 通过例子我们也可以了解到: 由于设置了监视器, 所以调用 uv_run ...
- error while loading shared libraries: libaio.so.1: cannot open shared object file: No such file or directory
编译出现如下错误: error while loading shared libraries: libaio.so.1: cannot open shared object file: No such ...
随机推荐
- 网站性能Web压力测试工具webbench
webbench最多可以模拟3万个并发连接去测试网站的负载能力,个人感觉要比Apache自带的ab压力测试工具好,安装使用也特别方便. 1.适用系统:Linux 2.编译安装: wget http:/ ...
- Android-深入理解android自定义属性(AttributeSet,TypedArray)
属性 自定义属性,首先要定义出来属性,我们新建一个attrs.xml: <?xml version="1.0" encoding="utf-8"?> ...
- iOS-UIView category
UIView+Extension.h #import <UIKit/UIKit.h> @interface UIView (Extension) @property (nonatomic, ...
- C++构造函数详解及显式调用构造函数
来源:http://www.cnblogs.com/xkfz007/archive/2012/05/11/2496447.html c++类的构造函数详解 ...
- cdrecord光盘烧录工具
我们是透过 cdrecord 这个命令来进行文字介面的烧录行为,这个命令常见的选项有底下数个: [root@www ~]# cdrecord -scanbus dev=ATA <==查询烧录机位 ...
- sql 联合查询并更新
update sales set sales.adminId = t.adminIdfrom (select a.adminId,a.realName from sales ,admin_admini ...
- IOS AFNetworking
http://www.coneboy.com/?p=716 AFNetworking 使用总结 (用法+JSON解析) 2013 年 4 月 11 日 No comments Article 这几天 ...
- Sort List
采用归并排序,通过定义快.慢两个指针来找到中点,再采用之前的排序算法进行归并. ListNode *listSort(ListNode *head) { //定义快慢指针,找到链表中心 ListNod ...
- ecshop的商品系统数据库整合
-- 表的结构 `ecs_shop_config` '全站配置信息表' 商店设置 `id` '全站配置信息自增id',`parent_id` '父节点id,取值于该表id字段的值',`co ...
- 使用git如何批量对文件进行rm操作
git add -A 它会把我们未通过 git rm 删除的文件全部stage 转自: http://segmentfault.com/q/1010000000095373