Ue 4.11 build errors when including winpcap

When trying to build a plugin that depends on WinPCAP I get a lot of errors like the following:

f:\program files (x86)\epic games\4.11\engine\source\runtime\core\public\Misc/DisableOldUETypes.h(28): note: or ‘DoNotUseOldUE4Type::INT’

C:\Program Files (x86)\Windows Kits\8.1\include\shared\ws2def.h(275): error C2872: ‘INT’: ambiguous symbol

C:\Program Files (x86)\Windows Kits\8.1\include\shared\minwindef.h(176): note: could be ‘int INT’

It appears that it is erroring out on includes from the third party library. Is there a way to disable/fix this?

Hello AoiGhost,

I don’t believe this will work although I’m not familiar with using WinPCAP. It seems that it is reliant on these two header files from the 8.1 Windows SDK. Due to this, it’s failing as these headers are conflicting with the datatypes used in the engine which is why it’s mentioning “INT”. While I know there is mention of people using WinPCAP with the engine for packet capture, I’m not sure that it is compatible to be used with a plugin for the engine.

As far as fixing it, it may involve editing the DisableOldUETypes.h in a source build of the engine but I’m not exactly sure what changes would need to be made.

Where we need access to the Windows types in engine, we wrap the include in:

#include "AllowWindowsPlatformTypes.h"
#include "winsock.h"
#include "HideWindowsPlatformTypes.h"

https://answers.unrealengine.com/questions/27560/trouble-using-windows-includes-with-dword-int.html