Can't build Unreal Editor 4.27.2 from source

Hi everyone,

I’m having a hard time building the engine from source consistently. Sometimes it works sometimes it doesn’t. I tried here to do a fresh build and I’m stuck with errors.

Severity Code Description Project File Line Suppression State
Error C4668 ‘_NOEXCEPT_TYPES_SUPPORTED’ is not defined as a preprocessor macro, replacing with ‘0’ for ‘#if/#elif UE4 C:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\winrt\wrl\event.h 211
Error C4668 ‘__cpp_noexcept_function_type’ is not defined as a preprocessor macro, replacing with ‘0’ for ‘#if/#elif UE4 C:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\winrt\wrl\event.h 211
Error C4668 ‘_NOEXCEPT_TYPES_SUPPORTED’ is not defined as a preprocessor macro, replacing with ‘0’ for ‘#if/#elif UE4 C:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\winrt\wrl\event.h 371
Error C4668 ‘__cpp_noexcept_function_type’ is not defined as a preprocessor macro, replacing with ‘0’ for ‘#if/#elif UE4 C:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\winrt\wrl\event.h 371
Error MSB3073 The command …..\Build\BatchFiles\Build.bat -Target=UE4Editor Win64 Development -Target=ShaderCompileWorker Win64 Development -Quiet -WaitMutex -FromMsBuild exited with code 6. UE4 C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.MakeFile.Targets 45

To reproduce here are the step I do:
Clone UE
git clone -b 4.27.2-release https://github.com/EpicGames/UnrealEngine.git 4.27.2-release
Launch Setup.bat, GenerateProjectFiles.bat
Open UE4.sln → Setup Development Editor & Win64 → right click on UE4 → Build

I use Visual Studio Community 2019, version 16.11.19
In the Tools & Features I have selected .NET desktop, C++ desktop, Unity video game & C++ games development (the names might differentiate but you get the idea)

Here is the log of the build

Build started...
1>------ Build started: Project: UE4, Configuration: Development_Editor x64 ------
1>Using 'git status' to determine working set for adaptive non-unity build (C:\Epic\4.27.2-release).
1>Building UE4Editor and ShaderCompileWorker...
1>Using Visual Studio 2019 14.29.30146 toolchain (C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133) and Windows 10.0.22621.0 SDK (C:\Program Files (x86)\Windows Kits\10).
1>Building 4 actions with 24 processes...
1>  [1/4] Module.HoloLensTargetPlatform.cpp
1>C:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\winrt\wrl/event.h(211): error C4668: '_NOEXCEPT_TYPES_SUPPORTED' is not defined as a preprocessor macro, replacing with '0' for '#if/#elif'
1>C:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\winrt\wrl/event.h(211): error C4668: '__cpp_noexcept_function_type' is not defined as a preprocessor macro, replacing with '0' for '#if/#elif'
1>C:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\winrt\wrl/event.h(371): error C4668: '_NOEXCEPT_TYPES_SUPPORTED' is not defined as a preprocessor macro, replacing with '0' for '#if/#elif'
1>C:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\winrt\wrl/event.h(371): error C4668: '__cpp_noexcept_function_type' is not defined as a preprocessor macro, replacing with '0' for '#if/#elif'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.MakeFile.Targets(45,5): error MSB3073: The command "..\..\Build\BatchFiles\Build.bat -Target="UE4Editor Win64 Development" -Target="ShaderCompileWorker Win64 Development -Quiet" -WaitMutex -FromMsBuild" exited with code 6.
1>Done building project "UE4.vcxproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 2 up-to-date, 0 skipped ==========

Any idea what I’m missing ? Is there something that should be installed on the computer ?

1 Like

I get the exact same set of errors.

I downloaded https://github.com/ufna/UnrealEngine/tree/4.27-html5_dev from github which is a version of ue 4.27 including HTML export, my visual studio is 2022 as I use windows 11, and when I open the sln file with visual studio 2017, or 2019 the target is marked as “incompatible”.

I really need to get this version compiled as I have an important project to do with HTML, but no hope yet.

Would really appreciate if someone shows up and offers something.

1 Like

I think I tried to compile Unreal 4.27.x with VS2022 and it did fail too. Have you tried with VS2019 ?

Have you try these SDK?

and also these


By the way, I use VisualStudioCommunity 2019.
The pictures are capture from VisualStudioInstaller for 2019.

1 Like

Here it’s what I have installed on my part (sorry the list is in french)


image
image
image
image
image

image

I will add Windows 10 SDK (10.0.18362.0) but I think I had read that 10.0.19 was mandatory. We will see.

I got exactly same issue, the visual studio are using window 10 sdk 10.0.22, which is not support by visual studio 2019. So, there is a way to configure visual studio to use different version of window 10 sdk.

A evidence for this is you can’t isntall window10 sdk 10.0.22 in the visual studio 2019 installer

I got exactly same issue, the visual studio are using window 10 sdk 10.0.22, which is not support by visual studio 2019. So, there is a way to configure visual studio to use different version of window 10 sdk.

A evidence for this is you can’t isntall window10 sdk 10.0.22 in the visual studio 2019 installer

Edited: 10.0.22 is actually window 11 sdk, so that may cause the error

Worked for me with 4.27 and VS2022. Got it compiled and it’s running all as intended.

  1. Use Windows 10 SDK(10.0.18362.0) and Unload Windows 11 SDK
  2. Reset computer
  3. delete Engine\Intermediate\Build\Win64\UE4Editor\Development\VisualStudioDTE” folder
  4. run Setup.bat and GenerateProjectFiles.bat
  5. open .sln and build ue4
7 Likes

I can confirm this works. make sure that the proper sdk version is installed. and maybe it should be the only one present.

Hey everyone, I’m glad it should be working but I’m still stuck. I have removed all SDK except 10.0.18362.0 and I’m still using VS2019.
I tried also to compile it in a high root folder like C:\UE\ to avoid long path errors on Windows.
These are the selected packages that I have now
image



image
image
image
image

image
image

Since last time I created a Jenkins pipeline so I can test it from scratch easily.
Here is the output log from the last failed build (with the last steps). Sorry it is in french, it should be in english next time.

https://files.cynaptek.com/msbuild output.txt

Well I just made it working.
By reading other posts from here I have removed .NET Core 3.1 and installed specifically .NET 4.5 (aim pack ? somthing like that and not 4.5.1 or 4.5.2)
The compilation from the editor worked after that.

I did not test my jenkins script yet.

I added bEnableUndefinedIdentifierWarnings = false at the end of the HoloLensTargetPlatform.Build.cs file, and the compilation passed~

13 Likes

Had the same error/warning with VSC2022 and disabling warnings in Build.cs solved the issue.

This works for me.

Here they explain it very well, you have to install visual studio 2017 with the things mentioned and compile with visual studio 2022.

This works for me as well, but why does anyone know why adding this to the HoloLensTargetPlatform in particular works?