Unable to compile project - "missing cl.exe"

So, I’ve been trying to create a C++ project for a couple hours now, but all my attempts have ended up in failure, with the following error message:

Running C:/Program Files/Epic
Games/UE_4.17/Engine/Binaries/DotNET/UnrealBuildTool.exe
MyProject Development Win64
-project=“D:/Projects/UE4/MyProject/MyProject.uproject”
-editorrecompile -progress -NoHotReloadFromIDE
Creating makefile for MyProject (no existing makefile)
Performing full C++ include scan (no include cache file)
@progress push 5%
Parsing headers for MyProjectEditor
Running UnrealHeaderTool “D:\Projects\UE4\MyProject\MyProject.uproject”
“D:\Projects\UE4\MyProject\Intermediate\Build\Win64\MyProjectEditor\Development\MyProjectEditor.uhtmanifest”
-LogCmds=“loginit warning, logexit warning, logdatabase error”
-Unattended -WarningsAsErrors -installed
Reflection code generated for MyProjectEditor in 8.3963873 seconds
@progress pop
ERROR: No 32-bit compiler toolchain found in C:\Program Files
(x86)\Microsoft Visual Studio
14.0\VC\bin\cl.exe

The same error happens when adding C++ code to a Bluepritn project.


Some info that should be relevant:

  • I am using Visual Studio Community 2017;
  • I have tried installing unreal by itself and through the Visual Studio
    Installer;
  • I have checked basically all C++ related items in the installer;
  • I have downloaded and installed the C++ build tools for visual studio
    2015, as suggested in some answers;
  • I have uninstalled, re-downloaded and re-installed both Visual Studio and Unreal, at least three times
  • I DO have cl.exe in my machine, just not in the path Unreal seems to want it. Instead of being directly in the “bin” folder, it is inside a folder named “amd64”, which is inside “bin”. I tried simply coping the contents from “amd64” to “bin”, which resulted in another error:

Running C:/Program Files/Epic
Games/UE_4.17/Engine/Binaries/DotNET/UnrealBuildTool.exe
MyProject Development Win64
-project=“D:/Projects/UE4/MyProject/MyProject.uproject”
-editorrecompile -progress -NoHotReloadFromIDE
Creating makefile for MyProject (no existing makefile)
Performing full C++ include scan (no include cache file)
@progress push 5%
Parsing headers for MyProjectEditor
Running UnrealHeaderTool “D:\Projects\UE4\MyProject\MyProject.uproject”
“D:\Projects\UE4\MyProject\Intermediate\Build\Win64\MyProjectEditor\Development\MyProjectEditor.uhtmanifest”
-LogCmds=“loginit warning, logexit warning, logdatabase error”
-Unattended -WarningsAsErrors -installed
Reflection code generated for MyProjectEditor in 8.1166803 seconds
@progress pop
Performing 9 actions (4 in parallel)
[2/9] Resource ModuleVersionResource.rc.inl
[3/9] Resource PCLaunch.rc
SharedPCH.Engine.cpp
C:\Program Files\Epic Games\UE_4.17\Engine\Source\Runtime\Core\Public\HAL/PlatformCrt.h(5):
fatal error C1083: Cannot open include
file: ‘new’: No such file or directory
ERROR: UBT ERROR: Failed to produce item:
D:\Projects\UE4\MyProject\Binaries\Win64\UE4Editor-MyProject.dll
Total build time: 17.57 seconds (Local executor: 0.00 seconds)

Some research hinted at this error being the result of something missing regarding .net, so I also tried installing everything related to it without any success.


All that said… anyone has any suggestions?

Did you have tried create an hello world c++ project with visual studio and build success?

Is this a project from another computer?
If yes, you can try this:
Right click the .uproject file and choose “Generate Visual Studio project files”.
You can also try “Switch Unreal Engine version” and choose 4.17, even if your project is 4.17. It seems to adjust Unreal files path when your project came from another computer.

Yes, I am able to create, build and run a simple C++ console project

No, I’ve been trying to create a new project again and again on the same computer. Asking unreal to generate the project files or switch versions did not do anything beyond displaying a little progress bar which fills up and then disappears…

Well, I was finally able to make it work… by resetting Windows. Yup, made it remove all programs and leave my files.

Once that was done, I downloaded Visual Studio Community 2017 and, through it, Unreal.

Now it compiles C++ projects just fine. I haven’t played around with it too much yet, but at least this particular problem was fixed.