简体   繁体   中英

Using winpcap library in qt creator

i need to use winpcap library in my c++11/qt5 project, and just after including library i'm getting errors like on the screenshot: click .
In pro file i have

QMAKE_CXXFLAGS += -std=c++11 -lwpcap
INCLUDEPATH += D:/Qt/Pr_inz1/WpdPack/Include
LIBS += -L D:/Qt/Pr_inz1/WpdPack/Lib -lwpcap -lpacket

I'm including this library like this:

extern "C"
{
    #include <pcap.h>
    #include <winsock.h>
}

How can fix problems with

'u_int' does not name a type typedef u_int bpf_u_int32;
'bpf_u_int32' does not name a type bpf_u_int32 snaplen;

I tried add

#include <cstdint>
#include <cstdio>

but this nothing helps.

尝试#include <winsock2.h>之前#include <pcap.h>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM