Visual studio compiler wrong path (how to change?)

Thank you. Solved my question. = w =

I’m trying to either create a c++ project or generate visual studio project files, and always gets an error like the one below.

In UE editor settings, I have 3 editors available:
“Visual Studio”, “Visual Studio 2015”, and “Visual Studio 2017”
(note I have removed visual studio 2015, and only have 2017 left)

doesn’t matter which one I choose, the error (and the compiler path) is the same.
Also note there is currently no “Microsoft Visual Studio 14.0” directory on my computer,
so the path is completely incorrect.

I also don’t have any environment variables regarding the path.

How do I tell UE where visual studio is installed, or where the compiler is?
or how does it detect it?

The error:


Running D:/Program Files/Epic Games/UE_4.16/Engine/Binaries/DotNET/UnrealBuildTool.exe MyProject2 Development Win64 -project="D:/dev/games/MyProject2/MyProject2.uproject" -editorrecompile -progress -NoHotReloadFromIDE
Performing full C++ include scan (building a new target)
Creating makefile for MyProject2 (no existing makefile)
@progress push 5%
Parsing headers for MyProject2Editor
  Running UnrealHeaderTool "D:\dev\games\MyProject2\MyProject2.uproject" "D:\dev\games\MyProject2\Intermediate\Build\Win64\MyProject2Editor\Development\MyProject2Editor.uhtmanifest" -LogCmds="loginit warning, logexit warning, logdatabase error" -Unattended -WarningsAsErrors -installed
Reflection code generated for MyProject2Editor in 10.0282773 seconds
@progress pop
ERROR: No 32-bit compiler toolchain found in D:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\cl.exe

Hello matan19,

Can you change compiler version. For this go to Project Settings > Windows > Compiler Version(Under Toolchain Tab).

how do I change that for a non-specific project?

The only project I can actually open is a non-c++ project.

details below why I can’t open a c++ project, although it shouldn’t matter
(when trying to open any c++ project I’m getting an error saying

The following modules are missing or built with a different engine version:
UE4Editor-MyProject.dll
Would you like to rebuild them now?

If I press no, it exists.
If I press yes, it attempts to compile using the default toolchain which doesn’t work.

I found a trick:
I’ve created a non-c++ project (which opens fine), I then added a c++ class, at which point I got a c++ project opened in the editor.

I then changed the toolchain where you said - but I’m still getting the same error:

Running D:/Program Files/Epic Games/UE_4.16/Engine/Binaries/DotNET/UnrealBuildTool.exe  -projectfiles -project="D:/dev/games/TestComposition/TestComposition.uproject" -game -rocket -progress
Discovering modules, targets and source code for project...
ERROR: No 32-bit compiler toolchain found in D:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\cl.exe

Can you try this? Maybe helpul.

200700-verify.png

Foudn the answer - thanks to UE being open source!

I’ve looked at the github code and found where it was taking the path from; it was the following registry key:

HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\VisualStudio\SxS\VC7

which inside of it was an entry named “14.0” with the non-existing path.
I deleted it, created a new one with “15.0” with the correct path ( “D:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC” for me ), restarted the editor - and it now works.

p.s.
The above registry key path is just the third path UE will look for; the correct order is:

 1. HKEY_CURRENT_USER\SOFTWARE\Microsoft\VisualStudio\SxS\VC7
 2. HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\SxS\VC7
 3. HKEY_CURRENT_USER\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\SxS\VC7
 4. HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\SxS\VC7
1 Like

I didn’t try your solution since I’ve found mine in the meantime (look below).

I would suspect it wouldn’t matter though, since the problem was with registry keys / visual studio / windows, and not actually unreal engine.

Thank you though!

HOLY SMOKES, this totally fixed my issue! Thank you so much! You are a life saver!

Hi matan19
I tried your method changing registry keys, but i could not find any SxS files in HKEY_CURRENT_USER beyond visualstudio

nevertheless I tried and this is what came up
//An error occurred while trying to generate project files.

Running D:/Program Files/Epic Games/UE_4.15/Engine/Binaries/DotNET/UnrealBuildTool.exe -projectfiles -project=“C:/Users/Hari/Documents/Unreal Projects/MyProject2/MyProject2.uproject” -game -rocket -progress
UnrealBuildTool Exception: System.ArgumentException: Illegal characters in path.
at System.IO.Path.LegacyNormalizePath(String path, Boolean fullCheck, Int32 maxPathLength, Boolean expandShortPaths)
at System.IO.Path.GetFullPathInternal(String path)
at System.IO.Path.GetFullPath(String path)
at UnrealBuildTool.DirectoryReference…ctor(String InPath)
at UnrealBuildTool.WindowsPlatform.TryReadDirRegistryKey(String KeyName, String ValueName, DirectoryReference& Value)
at UnrealBuildTool.WindowsPlatform.TryReadInstallDirRegistryKey32(String KeySuffix, String ValueName, DirectoryReference& InstallDir)
at UnrealBuildTool.WindowsPlatform.TryGetVCInstallDir(WindowsCompiler Compiler, DirectoryReference& InstallDir)
at UnrealBuildTool.WindowsPlatform.GetDefaultCompiler(String[] Arguments, FileReference ProjectFile)
at UnrealBuildTool.UnrealBuildTool.DoPostStartupStuffThatCanAccessConfigs(String[] Arguments)

//

thanks in advance!!

thank you so much , i got same problem.

Thank you. This is the right answer for me.

Thanks mate. Worked for me :slight_smile:

Works! Wish I could upvote twice – spent hours banging my head against this one :wink:

where do you go to edit the github code?

Hey bud. I have a fix for you man. I know this is way later down the track but. If you have that error it means it cannot find what it needs in the location.

I had this error when I had the wrong file path. Jump into VC# which is the next registry below and copy and past one of those file directories into the newly created or edited 15.0 or 17.0 (17.0 in my case) and past the path from the other registry. This fixed my issue.

Dont mind my english… cbf fixing grammar.

@Jack W Lewis, its not in the git code, you edit a key inside the windows register (regedit).

@matan19 thanks you!! I spend all day try to fix this. tks :slight_smile:

This didn’t work. Either that or I did it wrong. The latter is 100% likely. In the registry, I deleted 14.0, made a new key, but couldn’t rename it to anything. HELPPPPPPPPPP. :frowning:

What do you mean you “couldn’t rename it to anything” ?

  1. Did you check the path I wrote is the correct path for you? Or if not, found the correct path for you?
  2. Did you create a new entry with name “15.0” and value with the path from #1 ?

Ok, so I was dumb and was creating the wrong value… Fixed that part. The real problem is that my path is different than yours. inside of G:\Program Files (x86)\Microsoft Visual Studio\2017, there’s no VC folder, just a BuildTools folder.