linux系统找不到libexpat
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/21557166/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
libexpat could not be found by linux system
提问by unresolved_external
I am developing with vddk library for ubuntu 12.10 i386. I constantly get following error:
我正在为 ubuntu 12.10 i386 开发 vddk 库。我不断收到以下错误:
Cannot open library: libexpat.so.0: cannot open shared object file: No such file or directory.
When I run apt-file search libexpat.so
it shows me following
当我运行时,apt-file search libexpat.so
它显示我正在关注
lib64expat1: /usr/lib64/libexpat.so.1
lib64expat1: /usr/lib64/libexpat.so.1.6.0
lib64expat1-dev: /usr/lib64/libexpat.so
libexpat1: /lib/i386-linux-gnu/libexpat.so.1
libexpat1: /lib/i386-linux-gnu/libexpat.so.1.6.0
libexpat1-dev: /usr/lib/i386-linux-gnu/libexpat.so
I already tried to create a symlink
我已经尝试创建一个符号链接
sudo ln -s /usr/lib/i386-linux-gnu/libexpat.so /usr/lib/i386-linux-gnu/libexpat.so.0
but it did not work. Strange thing:
但它没有用。奇怪的事情:
ls -l `locate libexpat.so`
ls: cannot access /lib/i386-linux-gnu/libexpat.so.1: No such file or directory
ls: cannot access /lib/i386-linux-gnu/libexpat.so.1.6.0: No such file or directory
ls: cannot access /usr/lib/vmware-vix-disklib/lib64/libexpat.so.0: No such file or directory
-rw-r--r-- 1 ubuntu ubuntu 141320 Aug 20 09:21 /home/ubuntu/vddk/lib64/libexpat.so.0
-rw-r--r-- 1 root root 141320 Feb 3 16:45 /usr/lib/vmware-vix-disk-lib/vmware-vix-disk-lib/lib64/libexpat.so.0
-rw-r--r-- 1 root root 141320 Aug 20 09:21 /usr/vmware-vix-disklib-distrib/lib64/libexpat.so.0
采纳答案by unresolved_external
Fixed by manually downloading and installing libexpat package form here http://expat.sourceforge.net/and look for downloading page. It should take you to sourceforge page and select stable package
通过在这里http://expat.sourceforge.net/手动下载和安装 libexpat 包形式并查找下载页面来修复 。它应该带你到 sourceforge 页面并选择稳定包
回答by hek2mgl
apt-file
shows only the contents of a package, or in your case the package(s) by file name, but it works regardless of whether the package is installed or not.
apt-file
仅显示包的内容,或者在您的情况下按文件名显示包,但无论是否安装包,它都可以工作。
You need to install libexpat1
:
您需要安装libexpat1
:
sudo apt-get install libexpat1
If you are about to compile and link custom C programs against libexpat1
you will also need:
如果您要编译和链接自定义 C 程序,libexpat1
您还需要:
sudo apt-get install libexpat1-dev
回答by user3550565
Go to the source code download pageand build with the correct flag.
转到源代码下载页面并使用正确的标志构建。
Since you are building for x86, you'll need to run configure
like this:
由于您是为 x86 构建的,您需要configure
像这样运行:
./configure CFLAGS=-m32