Error when using visual studio to build ue4

when i click build in visual studio (im building the engine via script from github) i get about 14 errors. Here are the errors:

Severity Code Description Project File Line Suppression State
Error C1083 Cannot open include file: ‘corecrt.h’: No such file or directory ShaderCompileWorker G:\visual studio\VC\INCLUDE\crtdefs.h 10

Severity Code Description Project File Line Suppression State
Error C1083 Cannot open include file: ‘corecrt.h’: No such file or directory ShaderCompileWorker G:\visual studio\VC\INCLUDE\crtdefs.h 10

Severity Code Description Project File Line Suppression State
Error C1083 Cannot open include file: ‘corecrt.h’: No such file or directory ShaderCompileWorker G:\visual studio\VC\INCLUDE\crtdefs.h 10

Severity Code Description Project File Line Suppression State
Error Failed to produce item: G:\ScriptUE4Engine\UnrealEngine-4.11\UnrealEngine-4.11\Engine\Binaries\Win64\ShaderCompileWorker-Core.dll ShaderCompileWorker G:\ScriptUE4Engine\UnrealEngine-4.11\UnrealEngine-4.11\Engine\Intermediate\ProjectFiles\ERROR 1

Severity Code Description Project File Line Suppression State
Error MSB3075 The command “…\Build\BatchFiles\Rebuild.bat ShaderCompileWorker Win64 Development -waitmutex” exited with code 5. Please verify that you have sufficient rights to run this command. ShaderCompileWorker C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.MakeFile.Targets 46

Severity Code Description Project File Line Suppression State
Error C1083 Cannot open include file: ‘corecrt.h’: No such file or directory UE4 G:\visual studio\VC\INCLUDE\crtdefs.h 10

Severity Code Description Project File Line Suppression State
Error C1083 Cannot open include file: ‘corecrt.h’: No such file or directory UE4 G:\visual studio\VC\INCLUDE\crtdefs.h 10

Severity Code Description Project File Line Suppression State
Error C1083 Cannot open include file: ‘corecrt.h’: No such file or directory UE4 G:\visual studio\VC\INCLUDE\crtdefs.h 10

Severity Code Description Project File Line Suppression State
Error C1083 Cannot open include file: ‘corecrt.h’: No such file or directory UE4 G:\visual studio\VC\INCLUDE\crtdefs.h 10

Severity Code Description Project File Line Suppression State
Error C1083 Cannot open include file: ‘corecrt.h’: No such file or directory UE4 G:\visual studio\VC\INCLUDE\crtdefs.h 10

Severity Code Description Project File Line Suppression State
Error C1083 Cannot open include file: ‘corecrt.h’: No such file or directory UE4 G:\visual studio\VC\INCLUDE\crtdefs.h 10

Severity Code Description Project File Line Suppression State
Error C1083 Cannot open include file: ‘corecrt.h’: No such file or directory UE4 G:\visual studio\VC\INCLUDE\crtdefs.h 10

Severity Code Description Project File Line Suppression State
Error Failed to produce item: G:\ScriptUE4Engine\UnrealEngine-4.11\UnrealEngine-4.11\Engine\Binaries\Win64\UnrealHeaderTool-Core.dll UE4 G:\ScriptUE4Engine\UnrealEngine-4.11\UnrealEngine-4.11\Engine\Intermediate\ProjectFiles\ERROR 1

Severity Code Description Project File Line Suppression State
Error MSB3075 The command “…\Build\BatchFiles\Rebuild.bat UE4Editor Win64 Development -waitmutex” exited with code 5. Please verify that you have sufficient rights to run this command. UE4 C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.MakeFile.Targets 46

Hey RangerG-

If you’re using VS2013, you’ll need to upgrade to VS2015 for building the engine for 4.10 or later. From what I can tell based on the errors, it appears that there is a Visual Studio file that it cannot locate. Please try checking your Windows SDK installation and environment variables setup. If you still receive errors you may need to reinstall VS2015. If that doesn’t work, please explain what you mean by “building via script” as well as what engine version you are trying to compile? Something else to remember, when compiling the engine for the first time, you will need to build for Development Editor prior to building for any other configuration.

Cheers