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?
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
andwpcap.dll
static: rebuild them as such. You just sacrifice the ability to do anything, since all the stuff inwpcap.dll
requirespacket.dll
, and all the stuff inpacket.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.