Red hat9.0 Linux下安装libpcap库
2010-06-29 13:48
387 查看
安装前的预备工作:
1.确定已安装了gcc(2.4.6 or higher)。可以输入命令gcc --version来查看当前gcc版本。
2.确定已安装了GNU M4(V1.4.12)。
3.确定已安装了flex(V2.5.4 )。可以输入命令flex --version来查看当前flex版本。
下载地址:http://sourceforge.net/projects/flex/
4.确定已安装修了bison(V2.4.0)。可以输入命令bison --version来查看当前bison版本。
下载地址:http://ftp.gnu.org/gnu/bison/
完成了上面的几个步骤后,下面以安装libpcap(V4.1.1)
执行下列三个安装命令:
./configure
make
make install
注意:如果你已运行过./configure,重新运行./configure前,先运行make distclean 将先前配置清除.
测试用例(参见http://www.tcpdump.org/pcap.htm):
#include <stdio.h>
#include <pcap.h>
int main(int argc, char *argv[])
{
char *dev, errbuf[PCAP_ERRBUF_SIZE];
dev = pcap_lookupdev(errbuf);
if (dev == NULL) {
fprintf(stderr, "Couldn't find default device: %s/n", errbuf);
return(2);
}
printf("Device: %s/n", dev);
return(0);
}
编译:gcc -o device device.c -lpcap
这时运行后出,错误信息为./device: error while loading shared libraries: libpcap.so.1: cannot open shared object file: No such file or directory
找了半天都不知道是什么原因,后来在libpcap-1.1.1的README文件中提到一句:
It sets the soname of the library to "libpcap.so.1"; this is what it
should be, *NOT* libpcap.so.1.x or libpcap.so.1.x.y or something such as
that.
接下来就是找到libpcap.so.1.1.1文件,将其改为libpcap.so.1后拷贝文件到/usr/lib目录下。
接下来运行就OK了。
初次学LINUX,弄了一下午才安装好了个libpcap.
在这里要感谢网上一篇文章:http://blog.csdn.net/zhangzhenhu/archive/2010/05/12/5584119.aspx
1.确定已安装了gcc(2.4.6 or higher)。可以输入命令gcc --version来查看当前gcc版本。
2.确定已安装了GNU M4(V1.4.12)。
3.确定已安装了flex(V2.5.4 )。可以输入命令flex --version来查看当前flex版本。
下载地址:http://sourceforge.net/projects/flex/
4.确定已安装修了bison(V2.4.0)。可以输入命令bison --version来查看当前bison版本。
下载地址:http://ftp.gnu.org/gnu/bison/
完成了上面的几个步骤后,下面以安装libpcap(V4.1.1)
执行下列三个安装命令:
./configure
make
make install
注意:如果你已运行过./configure,重新运行./configure前,先运行make distclean 将先前配置清除.
测试用例(参见http://www.tcpdump.org/pcap.htm):
#include <stdio.h>
#include <pcap.h>
int main(int argc, char *argv[])
{
char *dev, errbuf[PCAP_ERRBUF_SIZE];
dev = pcap_lookupdev(errbuf);
if (dev == NULL) {
fprintf(stderr, "Couldn't find default device: %s/n", errbuf);
return(2);
}
printf("Device: %s/n", dev);
return(0);
}
编译:gcc -o device device.c -lpcap
这时运行后出,错误信息为./device: error while loading shared libraries: libpcap.so.1: cannot open shared object file: No such file or directory
找了半天都不知道是什么原因,后来在libpcap-1.1.1的README文件中提到一句:
It sets the soname of the library to "libpcap.so.1"; this is what it
should be, *NOT* libpcap.so.1.x or libpcap.so.1.x.y or something such as
that.
接下来就是找到libpcap.so.1.1.1文件,将其改为libpcap.so.1后拷贝文件到/usr/lib目录下。
接下来运行就OK了。
初次学LINUX,弄了一下午才安装好了个libpcap.
在这里要感谢网上一篇文章:http://blog.csdn.net/zhangzhenhu/archive/2010/05/12/5584119.aspx
相关文章推荐
- Red Hat 9.0 linux下安装lumaQQ
- Linux Red Hat 9.0上安装j2sdk1.4.2_08
- window下Linux 的安装和简单使用 & WMware Workstation 9.0中Linux(Red Hat) 的安装
- Vmware 安装 Red Hat 9.0 Linux 无法联网的解决办法
- red hat 9.0 在虚拟机里的安装
- VMware Workstation 中安装Redhat linux 9.0
- Vm 6.5下的linux上网设置(局域网,red hat 9.0)
- Red Hat 7 linux 配置yum仓库 并用yum 安装软件
- 在vpc下安装Red Hat 9.0
- 请教各位高手LINUX9.0安装问题。非常急。谢谢了。
- Linux(Red Hat)中安装Flash插件 | centos 6 64位安装flash player 插件
- 基于Fedora9.0和VMware6.5在Linux下的安装
- Linux(Red Hat 6 32位) 下安装Mysql5.6.30
- Linux(Red Hat)-中安装Vmware Tools
- Red Hat9.0与Win XP双系统安装指南
- ethereal.src.rpm软件在linux(Red Hat/Fedora)下的安装和使用
- [Linux]Mandrake 9.0安装和升级用法
- Informatica9.6.1在Linux Red Hat 5.8上安装遇到的有关问题整理_1
- Linux(Red Hat 6 32位) 下安装Mysql5.6.30