I want to use Pcap++ inside my Qt project. I've followed steps in the installation & introduction guide of PcapPlusPlus, but there are still unknowns:
- How do I implement that in my .pro file :
include ../../../Dist/mk/PcapPlusPlus.mk
- And that:
all:
g++.exe $(PCAPPP_INCLUDES) -c -o main.o main.cpp
g++.exe $(PCAPPP_LIBS_DIR) -static-libgcc -static-libstdc++ -o Tutorial-LiveTraffic.exe main.o $(PCAPPP_LIBS)
I've already add my LIBS and my INCLUDEPATH like that :
LIBS += -L/usr/local/lib/libCommon++.a -lCommon++
LIBS += -L/usr/local/lib/libPacket++.a -lPacket++
LIBS += -L/usr/local/lib/libPcap++.a -lPcap++
LIBS += -lpcap
INCLUDEPATH += /usr/local/include/pcapplusplus
And to give you an example, when I try to call code as follow in my main function:
#include <IPv4Layer.h>
#include <Packet.h>
#include <PcapFileDevice.h>
int main(int argc, char** argv) {
pcpp::PcapFileReaderDevice reader("the/path/example-app/1_packet.pcap");
return 0;
}
I got a lot of errors like this :
/tmp/cirrus-ci-build/PcapPlusPlus/Common++/header/Logger.h:173: error : undefined reference to `pcpp::LoggerPP::LoggerPP()'