Open KainWhite opened 4 years ago
Don't know if this is still relevant for you. But instead also define WIN32
in your file. pcap.h
shows this:
#if defined(WIN32)
#include <pcap-stdinc.h>
#elif defined(MSDOS)
#include <sys/types.h>
#include <sys/socket.h> /* u_int, u_char etc. */
#else /* UN*X */
#include <sys/types.h>
#include <sys/time.h>
#endif /* WIN32/MSDOS/UN*X */
Should work. Got the same error and fixed it with that.
@yeahitsjan Do you mean you were able to fix the missing DLL error by defining WIN32 in the source file?
I don't use Windows so it's hard for me to reproduce this. This was working fine last I tried it there, but I'm unsure of what version of Windows I used at the time.
@mfontanini Here are a few issues on Windows 11 I wanted to bring to your attention:
I'm gonna try the pre-built version and update the comment, but letting you know that Libtins seems broken on Windows when building from source.
I was able to figure it out by reading the NPCAP docs - they do ship wpcap.dll. I first only downloaded the NPCAP SDK - analogous to libtins saying to get the WinPCAP SDK - but didn't install NPCAP itself - doing that solved this issue: https://npcap.com/#download I think it can be closed. FYI @mfontanini @KainWhite
It'd be great if the libtins website were updated to reflect needing to use NPCAP instead of WPCAP.
Windows 10, MSVS 2019 I have started up with this code:
and tried to build it x86. Result was a bunch of LNK2019 errors, at the end of which there was this: "libtins-master\build\lib\Debug\tins.lib : warning LNK4272: library machine type 'x64' conflicts with target machine type 'x86'". Ok, tried to build it x64, result: "WpdPack\Include\pcap\pcap.h(47,12): fatal error C1083: Cannot open include file: 'sys/time.h': No such file or directory". In this file:
OOOOOK. (my code):
Builded again and finally successfully. But when I run it I got this:
I have tried installing Winpcap, that places needed dll in System32 folder, but then there are memory access violation in this code (sniffer.cpp):
Well, am I doing anything wrong?