0
/* Open the device */
if ( (adhandle= pcap_open(d->name,
                          65536,
                          PCAP_OPENFLAG_PROMISCUOUS,
                          1000,
                          NULL,
                          errbuf)
   ) == NULL)
   {
        fprintf(stderr,"\nUnable to open the adapter. %s is not supported by WinPcap\n", d->name);
        /* Free the device list */
        pcap_freealldevs(alldevs);
        return -1;
   }

This code is in this.
I included pcap.h.
But I can't use pcap_open() function.
identifier "pcap_open" is undefined

Please help me.

  • Did you actually look in `pcap.h` to see if `pcap_open()` was defined in it? Perhaps you are running into an issue similar to [this one](https://stackoverflow.com/questions/22601087/)? – Remy Lebeau Jan 01 '22 at 00:30
  • You don't really provide a lot of information. All i can really say is winpcap is deprecated. Try npcap instead. – Taekahn Jan 01 '22 at 02:50

0 Answers0