# Can't build unreal 4.26 from source. Error C4668 and MSB3073

**URL:** <https://forums.unrealengine.com/t/cant-build-unreal-4-26-from-source-error-c4668-and-msb3073/488326>\
**Category:** Platform & Builds\
**Tags:** unreal-engine, question, build-editor\
**Created:** [September 2, 2021, 7:36pm UTC](https://forums.unrealengine.com/t/cant-build-unreal-4-26-from-source-error-c4668-and-msb3073/488326 "2021-09-02T19:36:36Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Wheeze](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Wheeze](https://forums.unrealengine.com/u/Wheeze)\
**Post date:** [September 2, 2021, 7:36pm UTC](https://forums.unrealengine.com/t/cant-build-unreal-4-26-from-source-error-c4668-and-msb3073/488326/1 "2021-09-02T19:36:36Z")

</div>

This is the output log:

```
Build started...
1>------ Build started: Project: UE4, Configuration: Development_Editor x64 ------
1>Using 'git status' to determine working set for adaptive non-unity build (O:\UE4.26_S).
1>Waiting for 'git status' command to complete
1>Building UE4Editor and ShaderCompileWorker...
1>Using Visual Studio 2019 14.29.30133 toolchain (C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.29.30133) and Windows 10.0.16299.0 SDK (C:\Program Files (x86)\Windows Kits\10).
1>Building 4 actions with 8 processes...
1> [1/4] Module.ElectraPlayerRuntime.1_of_4.cpp
1>O:\UE4.26_S\Engine\Source\ThirdParty\Windows\DirectX\include\d3d12.h(427): error C4668: 'WINAPI_PARTITION_GAMES' is not defined as a preprocessor macro, replacing with '0' for '#if/#elif'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\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 ==========

```

First error C4668

```
Severity Code Description Project File Line Suppression State
Error C4668 'WINAPI_PARTITION_GAMES' is not defined as a preprocessor macro, replacing with '0' for '#if/#elif' UE4 O:\UnrealEngine\Engine\Source\ThirdParty\Windows\DirectX\include\d3d12.h 427 

```

Second error MSB3073

```
Severity Code Description Project File Line Suppression State
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\Professional\MSBuild\Microsoft\VC\v160\Microsoft.MakeFile.Targets 45    

```

I’m currently rebuilding the engine after deleting the “Engine\Intermediate\Build\Win64\UE4Editor” - meant to fix the second error but I have already tried downloading the source to a separate folder and building the engine, didn’t work.

---

<div class="post-metadata">

**Author:** ![DevinSherry](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/devinsherry/32/1101099_2.png) [@DevinSherry](https://forums.unrealengine.com/u/DevinSherry)\
**Post date:** [September 3, 2021, 8:05am UTC](https://forums.unrealengine.com/t/cant-build-unreal-4-26-from-source-error-c4668-and-msb3073/488326/2 "2021-09-03T08:05:17Z")

</div>

These types of errors are always a pain to try to figure out, so I can only really recommend some steps to hopefully resolve the issues:

1. Make sure you have the latest versions of Visual Studio 2019 and the different workloads/components required for Unreal Engine 4. This includes .NET desktop development (.NET framework stuff), Desktop development with C++, etc.
2. After installing the necessary components/updates, do a restart of the machine just to be sure.
3. After a restart, perform the setup.bat, then generateprojectfiles.bat.
4. If all goes well, open the UE4.sln in Visual Studio. Make sure the Startup project is UE4, the solution platform is Win64 and the solution configuration is Development Editor.
5. Once this is all confirmed, right-click the UE4 project under the Solution Explorer and select Rebuild.

I hope this helps, and good luck 🙂

 ![347905-solutionsettings.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/8/1/0814e5f165db1df57a6aad797176ea2aaad59e05.png)

![347906-rebuild.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/8/7/e87a9c04362e706c3d31c7368bb236c392188f7a.png)

---

<div class="post-metadata">

**Author:** ![vagabond00](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@vagabond00](https://forums.unrealengine.com/u/vagabond00)\
**Post date:** [April 23, 2022, 4:23pm UTC](https://forums.unrealengine.com/t/cant-build-unreal-4-26-from-source-error-c4668-and-msb3073/488326/3 "2022-04-23T16:23:48Z")

</div>

For the NOOBS: I had these same errors and it was driving me nuts. For all the noobs like me out there, what solved it was ignoring the ErrorList window and looking at the Output window. There were errors (mostly to do with linking files) that were blocking the compilation but not appearing as proper “Errors” in the error list. I hope this is helpful for anyone else having issues.
