sudo apt-get install lib32stdc++6

[2014-06-19 12:39:55 - android_marketing_zj] /home/exmyth/package/adt-bundle-linux-x86_64-20140321/sdk/build-tools/android-4.4.2/aapt: error while loading shared libraries: libstdc++.so.6: cannot open shared object file: No such file or directory

我最终通过安装解决:sudo apt-get install lib32stdc++6

I

在linux下运行程序时,发现了error while loading shared libraries这种错误

./tests: error while loading shared libraries: xxx.so.0:cannot open shared object file: No such file or directory
出现这类错误表示,系统不知道xxx.so放在哪个目录下,这时候就要在/etc/ld.so.conf中加入xxx.so所在的目录。

一般而言,有很多的so会存放在/usr/local/lib这个目录底下,去这个目录底下找,果然发现自己所需要的.so文件。

所以,在/etc/ld.so.conf中加入/usr/local/lib这一行,保存之后,再运行:/sbin/ldconfig –v更新一下配置即可。

II

一般我们在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

出处:http://blog.csdn.net/sahusoft/article/details/7388617
      http://www.vrlinux.com/shujukuyingyong/20100407/26958.html

sudo apt-get install lib32stdc++6

时间: 2024-08-03 14:53:12

sudo apt-get install lib32stdc++6的相关文章

解决ubuntu使用命令sudo apt -get install 安装东西时出现"E: Sub-process /usr/bin/dpkg returned an error code (1) "的错误

问题描述: 今天在使用命令 "sudo apt-get install python3-pip"安装时,总是出现如下图这样的错误,开始以为是以为自己python版本的问题,后来发现无论装什么东西都会出现,这样的错误,错误展示: 解决方案: 进入如下目录: cd /var/lib/dpkg 删除下面这个文件: sudo mv info info.baksudo 重新创建这个文件: sudo mkdir info 如下图所示: 再次安装: (1)安装pip3: sudo apt-get i

Deepin 15.11 安装软件出现“您也许需要运行“apt --fix-broken install”来修正上面的错误

解决方案: #sudo apt --fix-broken install -y 原文地址:https://www.cnblogs.com/xlpc/p/12317000.html

sudo apt install nvinfer*

sudo apt-get install gnupg-curl wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/cuda-repo-ubuntu1604_10.0.130-1_amd64.deb sudo dpkg -i cuda-repo-ubuntu1604_10.0.130-1_amd64.deb sudo apt-key adv --fetch-keys https://dev

sudo pip2.7 install pyopenssl失败,解决方法

环境deepin2014rc 运行goagent 提示缺少pyopenssl 于是 sudo pip2.7 install pyopenssl 但是有报错: c/_cffi_backend.c:14:17: fatal error: ffi.h: 没有那个文件或目录 #include <ffi.h> 解决方法: sudo apt-get install apt-file apt-file update apt-file search /ffi.h 然后 安装 libffi-dev之后继续 pi

sudo apt update出错 ,

文章来源:https://www.wandouip.com/t5i364432/ 为了处理最近一起安全事件,旧密钥已被撤销.所以在执行apt-get update 时会提示密钥错误,更换密钥即可.新的密钥和旧的密钥如下: old key: 421C365BD9FF1F717815A3895523BAEEB01FA116 new key: C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654 解决方法 首先要删除旧的密钥: 16.04以后的版本: sudo apt-ke

Auto yes to the License Agreement on sudo apt-get -y install oracle-java7-installer

参考一 参考二

sudo apt get update时的问题

原文地址:https://www.cnblogs.com/zxzmnh/p/11823022.html

system crashed by `apt remove libc6`

~$ sudo apt --fix-broken install Reading package lists... Done Building dependency tree Reading state information... Done Correcting dependencies... Done The following packages were automatically installed and are no longer required: asymptote asympt

Docker存储驱动之Device Mapper简介

Device Mapper是一个基于kernel的框架,它增强了很多Linux上的高级卷管理技术.Docker的devicemapper驱动在镜像和容器管理上,利用了该框架的超配和快照功能.为了区别,本文使用Device Mapper指驱动中的框架,而devicemapper指Docker的存储驱动. 注意:商业支持的Docker Engine(CS-Engine)建议在RHEL和CentOS上使用devicemapper存储驱动. AUFS之外的另一种选择 Docker最初运行在Ubuntu和