ubuntu动态链接库连接出错 cannot open shared object file: No such file or directory
2017-09-06 18:19
736 查看
项目背景:
在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 seconds
ldconfig -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
原因:
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上,使用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 seconds
ldconfig -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.
相关文章推荐
- 缺少动态连接库.so--cannot open shared object file: No such file or directory
- 动态链接库找不到 : error while loading shared libraries: libgsl.so.0: 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
- [11]缺少动态连接库.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
- cuda程序执行出错: libcudart.so.8.0: cannot open shared object file: No such file or directory
- 缺少动态连接库.so--cannot open shared object file: No such file or directory
- CentOS 运行 Java的图形出错: libXtst.so.6: 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
- CentOS 安装 oralce Java的图形出错: libXtst.so.6: 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
- 【Ubuntu 64bit】libz.so.1: cannot open shared object file: No such file or directory
- 缺少动态连接库.so--cannot open shared object file: No such file or directory
- ubuntu cannot open shared object file: no such file or directory