Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris

Comment on

( #3333=superdoc: print w/replies, xml ) Need Help??

UPDATE: This works for Net::Pcap 0.16 on MSWin32. If using Net::Pcap 0.17, see Re^5: Net::Pcap installation help (and not with the library)

There are bugs in the Net::Pcap code that have not been patched that affect Windows installations. You can see this by looking at the bug report here Our own Corion fixed it and provided patches.

I've gotten Net::Pcap to build successfully on Windows XP / Strawberry 5.10, 5.12, 5.14 and also Windows 7 x64 / Strawberry 5.14, 5.16. I've used the following process:



  1. Get Net::Pcap from CPAN - download .tar.gz file, not with CPAN client.
  2. Get patches:
  3. Edit patch files to remove the email headers.
  4. Copy *.patch files into the Net-Pcap directory.
  5. Apply patch files in order (0002, 0003, 0004, 0005) with:
      patch -p1 < FILENAME.patch

    NOTE: May have to 'unix2dos' the patch files if they don't work!


  1. Make sure WinPcap is installed - if not, install it
  2. Unzip WinPcap Developers Pack in same parent directory Net::Pcap was unzipped in, e.g.,:
  3. IF on x64 platform, check on the existence of the x64 libraries:
      dir WpdPack\lib\x64\*.a
  4. They may not exist. If not, built them:
      pexports \Windows\system32\wpcap.dll > wpcap.def
      dlltool --as-flags=--64 -m i386:x86-64 -k --output-lib libwpcap.a --input-def wpcap.def
      pexports \Windows\system32\Packet.dll > Packet.def
      dlltool --as-flags=--64 -m i386:x86-64 -k --output-lib libpacket.a --input-def Packet.def
      move libwpcap.a WpdPack\lib\x64
      move libpacket.a WpdPack\lib\x64
  5. Start the build process:
    perl Makefile.PL INC=-IC:/Users/VinsWorldcom/tmp/WpdPack/Include "LI +BS=-LC:/Users/VinsWorldcom/tmp/WpdPack/Lib/x64 -lwpcap" dmake dmake test

Test by creating

use Net::Pcap qw(:functions); @devs = pcap_findalldevs(\%devinfo, \$err); for my $dev (@devs) { print "$dev : $devinfo{$dev}\n" }


perl -Mblib

If successful output of adapters, install with:

dmake install

In reply to Re: Net::Pcap installation help (and not with the library) by VinsWorldcom
in thread Net::Pcap installation help (and not with the library) by binarygrrl

Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":

  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?

    What's my password?
    Create A New User
    and all is quiet...

    How do I use this? | Other CB clients
    Other Users?
    Others having an uproarious good time at the Monastery: (1)
    As of 2018-05-22 21:59 GMT
    Find Nodes?
      Voting Booth?