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

//-----------------------------------------------------------
//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
原因:
文件被破坏,重新下载。




更多推荐
所有评论(0)