PCAP installation (Debian7 Linux) qt use Pcap.h

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.