ubuntu动态链接库连接出错 cannot open shared object file: No such file or directory
来源:互联网 发布:淘宝怎么开通子账号 编辑:程序博客网 时间:2024/06/01 19:26
项目背景:
在Ubuntu上,使用zbar库识别二维码,安装了 zbar的库
测试本地动态链接库ldconfig 命令
#apt-get install libzbar-dev
#apt-get install zbar-tools
测试二维码库Zbar的代码:
zbarimg 1.png
//输出结果
QR-Code:1788
QR-Code:178813
QR-Code:178812
QR-Code:178814
scanned 4 barcode symbols from 1 images in 0.44 secondsldconfig -p|grep zbar
可以看到有几个链接库
发现一个很奇怪的事情,手动删除了动态链接库,发现zbarimg不能运行,此时还是正常的。 接下来使用 apt-get remove zbar-tools 删除zbar-tools,
又再一次 使用apt-get install zbar-tools 安装完成之后,发现zbarimg并不能运行
报错信息:
zbarimg: error while loading shared libraries: libzbar.so.0: cannot open shared object file: No such file or directory
解决方案
使用 apt-get build-dep zbar-tools
原因:
1、apt-get install 与 apt-get remove
使用remove 命令的时候,软件移除并不干净,使用install时 没有重新安装配置动态链接库
2、apt-get build-dep
apt-get build-dep 命令从源码 配置安装 ,会重新配置依赖项
以下是 man apt-get 命令中 关于 build-dep的解释
build-dep causes apt-get to install/remove packages in an attempt to satisfy the build dependencies for a source package. By default the dependencies are satisfied to build the package natively. If desired a host-architecture can be specified with the --host-architecture option instead.
- ubuntu动态链接库连接出错 cannot open shared object file: No such file or directory
- 缺少动态连接库.so--cannot open shared object file: No such file or directory
- 缺少动态连接库.so--cannot open shared object file: No such file or directory
- 缺少动态连接库.so--cannot open shared object file: No such file or directory
- 缺少动态连接库.so--cannot open shared object file: No such file or directory
- 缺少动态连接库.so--cannot open shared object file: No such file or directory
- 缺少动态连接库.so--cannot open shared object file: No such file or directory
- 缺少动态连接库.so--cannot open shared object file: No such file or directory
- 缺少动态连接库.so--cannot open shared object file: No such file or directory
- 缺少动态连接库.so--cannot open shared object file: No such file or directory
- 缺少动态连接库.so--cannot open shared object file: No such file or directory
- 缺少动态连接库.so--cannot open shared object file: No such file or directory
- 缺少动态连接库.so--cannot open shared object file: No such file or directory
- 缺少动态连接库.so--cannot open shared object file: No such file or directory
- 缺少动态连接库.so--cannot open shared object file: No such file or directory
- 缺少动态连接库.so--cannot open shared object file: No such file or directory
- linux 缺少动态连接库.so--cannot open shared object file: No such file or directory
- 缺少动态连接库.so--cannot open shared object file: No such file or directory
- C语言(Head First C)-8:高级函数:函数指针 qsort() 可变参数函数
- 自学编程之路——位运算
- javascript中的函数
- 屏蔽鼠标右键
- 下载文件的一种简单方法js
- ubuntu动态链接库连接出错 cannot open shared object file: No such file or directory
- iOS开发之同一应用设置不同图标和名称
- ECLIPSE/JAVAWEB (一)三大框架之STRUTS框架 持续更新中...
- beego
- Cocos2d-x里面如何实现MVC(三)
- 生成验证码的工具类和使用的servlet
- 持续集成 之 Jenkins插件 Multiple SCMs Plugin
- JNI调用java方法, new java对象,new java内部类
- TortoiseSVN 由于目标计算机积极拒绝 无法连接