Installation method One, sudo apt-get install Libpcap-dev
Installation Method II,
Go to http://www.tcpdump.org/to download the latest libpcap.tar.gz pack
After decompression
./configure here I did not add--frefix=path results to see below
Make
Make install
During the installation process./configure when the error, no lex we use flex instead, yum install flex can
Error in make will not find the command YACC we use Bison instead, yum install Bison can--------------error when you remember to use make clean the original cleared off
See http://blog.csdn.net/scutth/article/details/6894820 for details
The./configure uses the default path results Pcap installed under/usr/local/lib and Usr/local/include
But Qt's default header file is below/usr/include, which causes us to copy the Pcap-bpf.h pcap.h pcap-namedb.h and Pcap folders below/usr/local/include/to/usr/include
To correctly run Qt's PCAP project also wants QT's. Pro file to load the static library
This is my complete. Pro file:
TEMPLATE = App
CONFIG + = Console
CONFIG-= App_bundle
CONFIG-= qt
LIBS + =/USR/LOCAL/LIB/LIBPCAP.A//I added!
SOURCES + = Main.c
Note:
I found that the system comes with tcpdump--verison libpcap version 1.4 in/usr/lib/and/usr/include below LS |grep-l pcap can be viewed, do your own contrast
PCAP installation (Debian7 Linux) qt use Pcap.h