Plugin build - not included ws2def.h

Hello,

I have a blank project with a “Plugins” folder and inside my plugin - the dependencies are the following:

PublicDependencyModuleNames.AddRange(new string[] { "Engine", "Core", "CoreUObject", "Sockets", "Networking" });

Everything works fine when I play the level inside the editor, but as soon as i try to make a package (it doesn’t matter if it’s DebugGame, Development or Shipping) i have the infamous

1>C:\Program Files (x86)\Windows Kits\10\include\10.0.10586.0\shared\ws2def.h(263): error C2872: 'INT': ambiguous symbol
1>  C:\Program Files (x86)\Windows Kits\10\include\10.0.10586.0\shared\minwindef.h(176): note: could be 'int INT'
1>  j:\unreal\epic games\4.10\engine\source\runtime\core\public\Misc/DisableOldUETypes.h(28): note: or       'DoNotUseOldUE4Type::INT'

And

1>C:\Program Files (x86)\Windows Kits\10\include\10.0.10586.0\um\winsock2.h(942): error C2872: 'DWORD': ambiguous symbol
1>  C:\Program Files (x86)\Windows Kits\10\include\10.0.10586.0\shared\minwindef.h(156): note: could be 'unsigned long DWORD'
1>  j:\unreal\epic games\4.10\engine\source\runtime\core\public\Misc/DisableOldUETypes.h(34): note: or       'DoNotUseOldUE4Type::DWORD'

I’m aware of the normal procedure about wrapping the included header as:

 #include "AllowWindowsPlatformTypes.h"
 #include "MyLibraryHeader.h" 
 #include "HideWindowsPlatformTypes.h"

But since I haven’t included directly ws2def.h nor winsock2.h, this could be hard to do.

More precisely my includes came all (but “string”) from the UEFramework and they are:

#include "MyPluginPluginPrivatePCH.h"


#include "MyPluginPluginPrivatePCH.h" 
#include "MyPluginPlugin.h"


#include "Networking.h"


#include "CoreUObject.h"
#include "Engine.h"
#include "Delegate.h"
#include "Http.h"
#include "Map.h"
#include "Json.h"
#include "LatentActions.h"
#include "Core.h"
#include "Engine.h"
#include "SharedPointer.h"
#include "ModuleManager.h"
DECLARE_LOG_CATEGORY_EXTERN(MyPluginLog, Log, All);
#include "IMyPluginPlugin.h"
#include "MyPluginPlugin.h"
#include "MyPluginPluginClasses.h"


#include "ModuleManager.h"


#include "Engine.h"
#include "Networking.h"
#include "GameFramework/Actor.h"
#include <string>
#include "MyPlugin.generated.h"

I’m using Visual Studio 2015 Professional Update 2 and Unreal Engine 4.10.4

Do you have any suggestion?

Thank you

Found it:

#include "Http.h"

Even if it’s from the UEFramework this doesn’t mean it’s valid and usable to build a plugin…
Luckily I wasn’t relying too much on it.