1, 环境: Ubuntu14.04 + libpcap-1.6.1.tar.gz
2,Libpcap下载: 官方地址-http://www.tcpdump.org/#latest-release 即可下载最新版本的libpcap。
3,解压libpcap-1.6.1.tar.gz: tar -zxvf libpcap-1.4.0.tar.gz
4,配置生成makefile文件:cd到libpcap解压目录libpcap-1.4.0, 执行 ./configure。执行到这一步可能会遇到缺少flex包的问题:
configure: error: Your operating system's lex is insufficient to compile
libpcap. flex is a lex replacement that has many advantages, including
being able to compile libpcap. For more information, see
http://www.gnu.org/software/flex/flex.html .
解决办法:安装flex包---- sudo apt-get install flex
5,make
注意在make过程中可能会出错,按下面办法解决
ERROR! dnet header not found, go get it from
ERROR! daq_static library not found, go get it from
解决办法:安装byacc包--- sudo apt-get install -y byacc
apt-get install libpcre3-dev
apt-get install libdumbnet-dev