It is not a problem with WinPcap but with the inclusion order of the Windows header files.
You have not included
windows.h and
winsock.h. So they are included when needed by other header files. But the before mentioned header files must be included in a specific order.
I did not have your setup here for testing but including these on top should solve the problem:
#include <winsock2.h>
#include <windows.h>
Alternatively define
WIN32_LEAN_AND_MEAN
first:
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <winsock2.h>