Can`t compile ue4 project

The project failed to compile with this version of the engine. Build output is as follows:

Running E:/UE4 installl/Epic Games/4.7/Engine/Binaries/DotNET/UnrealBuildTool.exe mygame Development Win64 -project=“H:/ue4.7 project/mygame/mygame.uproject” -rocket -editorrecompile -progress
Parsing headers for mygameEditor
Reflection code generated for mygameEditor
Performing 7 actions (2 in parallel)
[2/7] Resource ModuleVersionResource.rc.inl
PCH.mygame.mygame.h.cpp
e:\ue4 installl\epic games\4.7\engine\source\runtime\core\public\Windows/PostWindowsApi.h(29) : fatal error C1189: #error : CRITICAL_SECTION relies on Windows.h/Xtl.h being included ahead of it
[3/7] Resource mygame.rc
H:\ue4.7 project\mygame\Source\mygame\Resources\Windows\mygame.rc(8) : fatal error RC1015: cannot open include file ‘windows.h’.

Runtime/Core/Public\Windows/WindowsPlatformCompilerSetup.h(184) : error RC2188: Runtime/Core/Public\Windows/WindowsPlatformCompilerSetup.h(184) : error RC2188: Runtime/Core/Public\Windows/WindowsPlatformCompilerSetup.h(184) : error RC2188: Runtime/Core/Public\Windows/WindowsPlatformCompilerSetup.h(184) : error RC2188: Runtime/Core/Public\Windows/WindowsPlatformCompilerSetup.h(184) : error RC2188: Runtime/Core/Public\Windows/WindowsPlatformCompilerSetup.h(184) : error RC2188: Runtime/Core/Public\Windows/WindowsPlatformCompilerSetup.h(184) : error RC2188: Runtime/Core/Public\Windows/WindowsPlatformCompilerSetup.h(184) : error RC2188: Runtime/Core/Public\Windows/WindowsPlatformCompilerSetup.h(184) : error RC2188: Runtime/Core/Public\Windows/WindowsPlatformCompilerSetup.h(184) : error RC2188: Runtime/Core/Public\Windows/WindowsPlatformCompilerSetup.h(184) : error RC2188: Runtime/Core/Public\Windows/WindowsPlatformCompilerSetup.h(184) : error RC2188: Runtime/Core/Public\Windows/WindowsPlatformCompilerSetup.h(184) : error RC2188: Runtime/Core/Public\Windows/WindowsPlatformCompilerSetup.h(184) : error RC2188: Runtime/Core/Public\Windows/WindowsPlatformCompilerSetup.h(184) : error RC2188: Runtime/Core/Public\Windows/WindowsPlatformCompilerSetup.h(184) : error RC2188: Runtime/Core/Public\Windows/WindowsPlatformCompilerSetup.h(184) : error RC2188: Runtime/Core/Public\Windows/WindowsPlatformCompilerSetup.h(184) : error RC2188: Runtime/Core/Public\Windows/WindowsPlatformCompilerSetup.h(184) : error RC2188: Runtime/Core/Public\Windows/WindowsPlatformCompilerSetup.h(184) : error RC2188: Runtime/Core/Public\Windows/WindowsPlatformCompilerSetup.h(184) : error RC2188: Runtime/Core/Public\Windows/WindowsPlatformCompilerSetup.h(184) : error RC2188: Runtime/Core/Public\Windows/WindowsPlatformCompilerSetup.h(184) : error RC2188: Runtime/Core/Public\Windows/WindowsPlatformCompilerSetup.h(184) : error RC2188: Runtime/Core/Public\Windows/WindowsPlatformCompilerSetup.h(184) : error RC2188: Runtime/Core/Public\Windows/WindowsPlatformCompilerSetup.h(184) : error RC2188: Runtime/Core/Public\Windows/WindowsPlatformCompilerSetup.h(184) : error RC2188: Runtime/Core/Public\Windows/WindowsPlatformCompilerSetup.h(184) : error RC2188: Runtime/Core/Public\Windows/WindowsPlatformCompilerSetup.h(184) : error RC2188: Runtime/Core/Public\Windows/WindowsPlatformCompilerSetup.h(184) : error RC2188: Runtime/Core/Public\Windows/WindowsPlatformCompilerSetup.h(184) : error RC2188: Runtime/Core/Public\Windows/WindowsPlatformCompilerSetup.h(184) : error RC2188: Runtime/Core/Public\Windows/WindowsPlatformCompilerSetup.h(184) : error RC2188: Runtime/Core/Public\Windows/WindowsPlatformCompilerSetup.h(184) : error RC2188: Runtime/Core/Public\Windows/WindowsPlatformCompilerSetup.h(184) : error RC2188: Runtime/Core/Public\Windows/WindowsPlatformCompilerSetup.h(184) : error RC2188: Runtime/Core/Public\Windows/WindowsPlatformCompilerSetup.h(184) : error RC2188: Runtime/Core/Public\Windows/WindowsPlatformCompilerSetup.h(184) : error RC2188: Runtime/Core/Public\Windows/WindowsPlatformCompilerSetup.h(184) : error RC2188: Runtime/Core/Public\Windows/WindowsPlatformCompilerSetup.h(184) : error RC2188: Runtime/Core/Public\Windows/WindowsPlatformCompilerSetup.h(184) : error RC2188: Runtime/Core/Public\Windows/WindowsPlatformCompilerSetup.h(184) : error RC2188: Runtime/Core/Public\Windows/WindowsPlatformCompilerSetup.h(184) : error RC2188: Runtime/Core/Public\Windows/WindowsPlatformCompilerSetup.h(184) : error RC2188: Runtime/Core/Public\Windows/WindowsPlatformCompilerSetup.h(184) : error RC2188: Runtime/Core/Public\Windows/WindowsPlatformCompilerSetup.h(184) : error RC2188: Runtime/Core/Public\Windows/WindowsPlatformCompilerSetup.h(184) : error RC2188: Runtime/Core/Public\Windows/WindowsPlatformCompilerSetup.h(184) : error RC2188: Runtime/Core/Public\Windows/WindowsPlatformCompilerSetup.h(184) : error RC2188: Runtime/Core/Public\Windows/WindowsPlatformCompilerSetup.h(184) : error RC2188: Runtime/Core/Public\Windows/WindowsPlatformCompilerSetup.h(184) : error RC2188: Runtime/Core/Public\Windows/WindowsPlatformCompilerSetup.h(184) : error RC2188: Runtime/Core/Public\Windows/WindowsPlatformCompilerSetup.h(184) : error RC2188: Runtime/Core/Public\Windows/WindowsPlatformCompilerSetup.h(184) : error RC2188: Runtime/Core/Public\Windows/WindowsPlatformCompilerSetup.h(184) : error RC2188: Runtime/Core/Public\Windows/WindowsPlatformCompilerSetup.h(184) : error RC2188: Runtime/Core/Public\Windows/WindowsPlatformCompilerSetup.h(184) : error RC2188: Runtime/Core/Public\Windows/WindowsPlatformCompilerSetup.h(184) : error RC2188: Runtime/Core/Public\Windows/WindowsPlatformCompilerSetup.h(184) : error RC2188: Runtime/Core/Public\Windows/WindowsPlatformCompilerSetup.h(184) : error RC2188: Runtime/Core/Public\Windows/WindowsPlatformCompilerSetup.h(184) : error RC2188: Runtime/Core/Public\Windows/WindowsPlatformCompilerSetup.h(184) : error RC2188: Runtime/Core/Public\Windows/WindowsPlatformCompilerSetup.h(184) : error RC2188: Runtime/Core/Public\Windows/WindowsPlatformCompilerSetup.h(184) : error RC2188: Runtime/Core/Public\Windows/WindowsPlatformCompilerSetup.h(184) : error RC2188: Runtime/Core/Public\Windows/WindowsPlatformCompilerSetup.h(184) : error RC2188: Runtime/Core/Public\Windows/WindowsPlatformCompilerSetup.h(184) : error RC2188: Runtime/Core/Public\Windows/WindowsPlatformCompilerSetup.h(184) : error RC2188: Runtime/Core/Public\Windows/WindowsPlatformCompilerSetup.h(184) : error RC2188: Runtime/Core/Public\Windows/WindowsPlatformCompilerSetup.h(184) : error RC2188: Runtime/Core/Public\Windows/WindowsPlatformCompilerSetup.h(184) : error RC2188: Runtime/Core/Public\Windows/WindowsPlatformCompilerSetup.h(184) : error RC2188: Runtime/Core/Public\Windows/WindowsPlatformCompilerSetup.h(184) : error RC2188: Runtime/Core/Public\Windows/WindowsPlatformCompilerSetup.h(184) : error RC2188: Runtime/Core/Public\Windows/WindowsPlatformCompilerSetup.h(184) : error RC2188: Runtime/Core/Public\Windows/WindowsPlatformCompilerSetup.h(184) : error RC2188: Runtime/Core/Public\Windows/WindowsPlatformCompilerSetup.h(184) : error RC2188: Runtime/Core/Public\Windows/WindowsPlatformCompilerSetup.h(184) : error RC2188: Runtime/Core/Public\Windows/WindowsPlatformCompilerSetup.h(184) : error RC2188: Runtime/Core/Public\Windows/WindowsPlatformCompilerSetup.h(184) : error RC2188: Runtime/Core/Public\Windows/WindowsPlatformCompilerSetup.h(184) : error RC2188: Runtime/Core/Public\Windows/WindowsPlatformCompilerSetup.h(184) : error RC2188: Runtime/Core/Public\Windows/WindowsPlatformCompilerSetup.h(184) : error RC2188: Runtime/Core/Public\Windows/WindowsPlatformCompilerSetup.h(184) : error RC2188: Runtime/Core/Public\Windows/WindowsPlatformCompilerSetup.h(184) : error RC2188: Runtime/Core/Public\Windows/WindowsPlatformCompilerSetup.h(184) : error RC2188: Runtime/Core/Public\Windows/WindowsPlatformCompilerSetup.h(184) : error RC2188: Runtime/Core/Public\Windows/WindowsPlatformCompilerSetup.h(184) : error RC2188: Runtime/Core/Public\Windows/WindowsPlatformCompilerSetup.h(184) : error RC2188: Runtime/Core/Public\Windows/WindowsPlatformCompilerSetup.h(184) : error RC2188: Runtime/Core/Public\Windows/WindowsPlatformCompilerSetup.h(184) : error RC2188: Runtime/Core/Public\Windows/WindowsPlatformCompilerSetup.h(184) : error RC2188: Runtime/Core/Public\Windows/WindowsPlatformCompilerSetup.h(184) : error RC2188: Runtime/Core/Public\Windows/WindowsPlatformCompilerSetup.h(184) : error RC2188: Runtime/Core/Public\Windows/WindowsPlatformCompilerSetup.h(184) : error RC2188: Runtime/Core/Public\Windows/WindowsPlatformCompilerSetup.h(184) : error RC2188: Runtime/Core/Public\Windows/WindowsPlatformCompilerSetup.h(184) : error RC2188: Runtime/Core/Public\Windows/WindowsPlatformCompilerSetup.h(184) : error RC2188: Runtime/Core/Public\Windows/WindowsPlatformCompilerSetup.h(184) : error RC2188: Runtime/Core/Public\Windows/WindowsPlatformCompilerSetup.h(184) : error RC2188: Runtime/Core/Public\Windows/WindowsPlatformCompilerSetup.h(184) : error RC2188: Runtime/Core/Public\Windows/WindowsPlatformCompilerSetup.h(184) : fatal error RC1003: error count exceeds 100; stopping compilation

-------- End Detailed Actions Stats -----------------------------------------------------------
ERROR: UBT ERROR: Failed to produce item: H:\ue4.7 project\mygame\Binaries\Win64\UE4Editor-mygame.dll
Cumulative action seconds (4 processors): 0.00 building projects, 4.80 compiling, 0.00 creating app bundles, 0.00 generating debug info, 0.00 linking, 0.00 other
UBT execution time: 20.33 seconds

Hello, 李刚

In this situation, it is likely that your Visual Studio installation somehow became corrupt. To fix it, please check whether Visual Studio’s InstallDir property is appropriate (the data should look something like this: C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE). Also, please make sure that environment variable Path is set correctly in your system (it has a value "C:\Windows\System32").

Finally, you can try repairing/reinstalling Visual Studio. Please don’t forget to reboot after installation.

Hope this helped!

Have a great day!