c++compilationpcaptcpdumpwinpcap

How to compile PCAP programm without installation require for costumer


I want to compile my libpcap and winpcap based programms, but I noticed that other users also have to install WinPCAP among my programm. How can I compile all necessary files into one programm?


Solution

  • Short answer: You can't.

    The long answer comes from some old wisdom in a WinPcap mailing list:

    There is a way to make packet.dll and wpcap.dll static: rebuild them as such. You just sacrifice the ability to do anything, since all the stuff in wpcap.dll requires packet.dll, and all the stuff in packet.dll requires the kernel driver. And the kernel driver won't exist without the full winpcap installation.

    It includes (among other things) a kernel driver that cannot be transformed to a static library.

    There is no way on Windows to make a kernel driver part of a static library. (Or a DLL, for that matter.) If the kernel driver is required, then it's hard to get anything done without it.