Getting 'DWORD': ambiguous symbol error building on Windows

I have an unreal project which builds perfectly for Mac, but it’s throwing build errors when I try to build with Visual Studio on Windows.

When I try to build, I get a hundred occurrences of this error: 'DWORD': ambiguous symbol error before the compiler gives up.

They all seem to be bubbling up from headers located in C:\Program Files (x86)\Windows Kits\8.1 which leads me to believe these are some kind of library headers which UE4 doesn’t agree with. I’m not sure why it would be building against Windows 8.1 (if that’s what’s happening) since I am running the build on Windows 10.

This project build fine on Windows before. I added some C++ classes to the project and edited the dependency modules since the last time it worked.

I am using Git to share code between workstations.

What could be causing me to run into this error?

Here’s the build output:

1>------ Build started: Project: FPSMovement, Configuration: Development_Editor x64 ------
1>  Creating makefile for FPSMovementEditor (no existing makefile)
1>  Performing full C++ include scan (no include cache file)
1>  Parsing headers for FPSMovementEditor
1>    Running UnrealHeaderTool "[REDACTED]" -LogCmds="loginit warning, logexit warning, logdatabase error" -Unattended -WarningsAsErrors -installed
1>  Reflection code generated for FPSMovementEditor in 4.6826186 seconds
1>  Performing 21 actions (4 in parallel)
1>  [2/21] Resource ModuleVersionResource.rc.inl
1>  [3/21] Resource PCLaunch.rc
1>  PCH.FPSMovement.h.cpp
1>  SAKCharacterMovementComponent.cpp
1>  WeaponBaseComponent.cpp
1>  FPSMovement.generated.cpp
1>  ProjectileWeaponComponent.cpp
1>  LightningSpellComponent.cpp
1>  LightningBoltActor.cpp
1>C:\Program Files (x86)\Windows Kits\8.1\include\shared\rpcasync.h(114): error C2872: 'DWORD': ambiguous symbol
1>  C:\Program Files (x86)\Windows Kits\8.1\include\shared\minwindef.h(156): note: could be 'unsigned long DWORD'
1>  c:\program files (x86)\epic games\4.11\engine\source\runtime\core\public\Misc/DisableOldUETypes.h(34): note: or       'DoNotUseOldUE4Type::DWORD'
1>C:\Program Files (x86)\Windows Kits\8.1\include\shared\rpcasync.h(126): error C2872: 'UINT': ambiguous symbol
1>  C:\Program Files (x86)\Windows Kits\8.1\include\shared\minwindef.h(177): note: could be 'unsigned int UINT'
1>  c:\program files (x86)\epic games\4.11\engine\source\runtime\core\public\Misc/DisableOldUETypes.h(31): note: or       'DoNotUseOldUE4Type::UINT'
1>C:\Program Files (x86)\Windows Kits\8.1\include\shared\rpcasync.h(384): error C2872: 'DWORD': ambiguous symbol
1>  C:\Program Files (x86)\Windows Kits\8.1\include\shared\minwindef.h(156): note: could be 'unsigned long DWORD'
1>  c:\program files (x86)\epic games\4.11\engine\source\runtime\core\public\Misc/DisableOldUETypes.h(34): note: or       'DoNotUseOldUE4Type::DWORD'
1>C:\Program Files (x86)\Windows Kits\8.1\include\shared\rpcasync.h(396): error C2872: 'DWORD': ambiguous symbol
1>  C:\Program Files (x86)\Windows Kits\8.1\include\shared\minwindef.h(156): note: could be 'unsigned long DWORD'
1>  c:\program files (x86)\epic games\4.11\engine\source\runtime\core\public\Misc/DisableOldUETypes.h(34): note: or       'DoNotUseOldUE4Type::DWORD'
1>C:\Program Files (x86)\Windows Kits\8.1\include\shared\wtypesbase.h(145): error C2872: 'DWORD': ambiguous symbol
1>  C:\Program Files (x86)\Windows Kits\8.1\include\shared\minwindef.h(156): note: could be 'unsigned long DWORD'
1>  c:\program files (x86)\epic games\4.11\engine\source\runtime\core\public\Misc/DisableOldUETypes.h(34): note: or       'DoNotUseOldUE4Type::DWORD'
1>C:\Program Files (x86)\Windows Kits\8.1\include\shared\wtypesbase.h(272): error C2872: 'DWORD': ambiguous symbol
1>  C:\Program Files (x86)\Windows Kits\8.1\include\shared\minwindef.h(156): note: could be 'unsigned long DWORD'
1>  c:\program files (x86)\epic games\4.11\engine\source\runtime\core\public\Misc/DisableOldUETypes.h(34): note: or       'DoNotUseOldUE4Type::DWORD'
1>C:\Program Files (x86)\Windows Kits\8.1\include\shared\wtypesbase.h(273): error C2872: 'DWORD': ambiguous symbol
1>  C:\Program Files (x86)\Windows Kits\8.1\include\shared\minwindef.h(156): note: could be 'unsigned long DWORD'
1>  c:\program files (x86)\epic games\4.11\engine\source\runtime\core\public\Misc/DisableOldUETypes.h(34): note: or       'DoNotUseOldUE4Type::DWORD'
1>C:\Program Files (x86)\Windows Kits\8.1\include\shared\wtypesbase.h(275): error C2872: 'DWORD': ambiguous symbol
1>  C:\Program Files (x86)\Windows Kits\8.1\include\shared\minwindef.h(156): note: could be 'unsigned long DWORD'
...
1>C:\Program Files (x86)\Windows Kits\8.1\include\um\combaseapi.h(663): error C2872: 'DWORD': ambiguous symbol
1>C:\Program Files (x86)\Windows Kits\8.1\include\um\combaseapi.h(663): error C2872: 'DWORD': ambiguous symbol
1>C:\Program Files (x86)\Windows Kits\8.1\include\um\combaseapi.h(663): fatal error C1003: error count exceeds 100; stopping compilationC:\Program Files (x86)\Windows Kits\8.1\include\um\combaseapi.h(663): fatal error C1003: error count exceeds 100; stopping compilation
1>
1>  -------- End Detailed Actions Stats -----------------------------------------------------------
1>ERROR : UBT error : Failed to produce item: C:\Users\Spencer Kohan\Documents\Unreal Projects\fps-movement\Binaries\Win64\UE4Editor-FPSMovement.dll
1>  Total build time: 7.57 seconds
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.MakeFile.Targets(37,5): error MSB3073: The command ""C:\Program Files (x86)\Epic Games\4.11\Engine\Build\BatchFiles\Build.bat" FPSMovementEditor Win64 Development "C:\Users\Spencer Kohan\Documents\Unreal Projects\fps-movement\FPSMovement.uproject" -waitmutex -2015" exited with code -1.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

I solved the problem: it turns out I was using ‘#import’ instead of ‘#include’ in a couple of places, which was causing problems on Windows.