I am trying to use the pcap++ library. I have downloaded the libraries for the VS2017, I linked the libraries and also the header files.
The libraries are:
Common++.lib
Packet++.lib
Pcap++.lib
and I made sure I am using the right release library.
When I build the solution, I am getting the error: LNK2019 unresolved external symbol _pcap_setfilter referenced in function "public: virtual bool __thiscall pcpp::IPcapDevice::setFilter
The code is simple:
#include "pch.h"
#include "IPv4Layer.h"
#include "Packet.h"
#include "PcapFileDevice.h"
int main(int argc, char* argv[])
{
// open a pcap file for reading
pcpp::PcapFileReaderDevice reader("1_packet.pcap");
if (!reader.open())
{
printf("Error opening the pcap file\n");
return 1;
}
reader.close();
return 0;
}
Does anyone have any idea on how to resolve this?