VS Code preferred version

I’ve used VS Code for a couple of years but with Ruby and Rails where it needs little to no configuration. Introducing C++ has turned it into a monster that is driving me nuts.
Noticing the following this mrining:

Visual Studio 2022 compiler version 14.40.33811 is not a preferred version. Please use the latest preferred version 14.38.33130
I opened the Installed Apps app (Win11) and modified it by selecting the MSVC v143 - VS 2022 C++ x64/x86 build tools (v14.38-17.8).
I noticed that MSVC v143 - VS 2022 C++ x64/x86 build tools (latest) was also checked but unchecking it brings up a warning, so that remained.
Modifying the installation on this basis broke compilation and has resulted in me wasting the whole day to get back to where I was this morning> Very frustrating.
Is the compiler version warning a big deal or can I live with it?
If I need to change it, can someone , please, tell me how in simple steps?

Do you mean it was still broken or did it break it further? In either case could you show the log after building after installing 14.38?

Hi Dan, thanks for the reply.
I’ve gone through the same process today. I must have misstepped yesterday because the compilation works today. However, I still get the warning.
These are the steps I’ve followed today:

  • Open the Microsoft Visual Studio Installer in Installed Apps
  • Say ‘Yes’ to ‘Do you want to allow changes?’
  • Choose Modify
  • Select Individual Components
  • Select 'MSVCv143 - VS 2022 x64/x86 build tools(v14.38 - 17.8)
  • Select Modify
  • Go to UE → Tools → Refresh Visual Studio Code Project
  • In UE, select recompile on the fly

Log output contains
Running D:\Program Files\Epic Games\UE_5.4\Engine\Build\BatchFiles\Build.bat -Target=“ObstacleAssaultEditor Win64 Development -Project=”“D:/Unreal Projects/ObstacleAssault/ObstacleAssault.uproject”"" -LiveCoding -LiveCodingModules=“D:/Program Files/Epic Games/UE_5.4/Engine/Intermediate/LiveCodingModules.json” -LiveCodingManifest=“D:/Program Files/Epic Games/UE_5.4/Engine/Intermediate/LiveCoding.json” -WaitMutex -LiveCodingLimit=100
Using bundled DotNet SDK version: 6.0.302
Running UnrealBuildTool: dotnet “…\Engine\Binaries\DotNET\UnrealBuildTool\UnrealBuildTool.dll” -Target=“ObstacleAssaultEditor Win64 Development -Project=”“D:/Unreal Projects/ObstacleAssault/ObstacleAssault.uproject”"" -LiveCoding -LiveCodingModules=“D:/Program Files/Epic Games/UE_5.4/Engine/Intermediate/LiveCodingModules.json” -LiveCodingManifest=“D:/Program Files/Epic Games/UE_5.4/Engine/Intermediate/LiveCoding.json” -WaitMutex -LiveCodingLimit=100
Log file: C:\Users\marti\AppData\Local\UnrealBuildTool\Log.txt
Building ObstacleAssaultEditor…
Using Visual Studio 2022 14.40.33811 toolchain (C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.40.33807) and Windows 10.0.22621.0 SDK (C:\Program Files (x86)\Windows Kits\10).
Warning: Visual Studio 2022 compiler is not a preferred version

I presume I have to tell UE to change the VSC compiler it’s using but I don’t know how.

If you have a preferred version installed it should already be, well, preferring it. However you’d likely need to build with Unreal closed for it build with a different version than what the existing .dll used (building with Unreal closed overwrites the existing .dll whereas Live Coding builds a new one to use as a patch)

The problem was that VSCode’s preferred compiler didn’t coincide with mine.
However, problem solved.

  1. Open the C/C++ extension in VSCode
  2. Click ‘Manage’ (the cog wheel next to uninstall)
  3. Choose extension settings
  4. Scroll down to C_cpp > Default: Compiler Path
  5. Click Edit in settings.json
  6. Make sure the last line reads as follows:
  7. “C_Cpp.default.compilerPath”: “C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.38.33130\bin\Hostx64\x86”
  8. Save

Compiler warning now disappears.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms