您的位置:首页 > 移动开发 > Objective-C

error while loading shared libraries: libpcap.so.1: cannot open shared object file: No such file or

2015-01-17 14:35 726 查看
//-----------------------------------------------------------

//AUTHOR:lanyang123456

//DATE:2011-11-10

//-----------------------------------------------------------

Linux系统下,运行sniff程序需要libpcap库。

首先下载安装该库,下载地址: http://www.tcpdump.org/

点击DOWNLOADS

 

下载后

(1)解压

(2)进入解压后文件目录, ./configure

(3)make install

默认安装目录/usr/local/lib

 

编译sniff程序通过,运行sniff程序时,出现如下错误:

./sn: error while loadingshared libraries: libpcap.so.1: cannot open shared object file: No such file ordirectory

 

由于libpcap已经安装,所以是程序无法找到库所在的位置的原因。

解决办法:

将libpcap.so.1所在目录添加到文件/etc/ld.so.conf中,

打开ld.so.conf文件,然后添加一行/usr/local/lib:

includeld.so.conf.d/*.conf //原来的内容

/usr/local/lib

然后保存,再终端下执行 ldconfig。

再运行sniff程序,OK。

 

 

 

有时用tar解压文件.错误如下:

gzip: stdin: unexpectedend of file tar: Unexpected EOF in archive tar: Unexpected EOF in archive tar:Error is not recoverable: exiting now

原因:

文件被破坏,重新下载。

原文:http://blog.csdn.net/lanyang123456/article/details/6956093
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐