Unable to generate C++ project after upgrading to Visual Studio 17.12 [blocking]

@Tamigore This was not working for me but i found a solution… the first three steps are as you described:

1.Uninstall Vs2022
2.Repair/Verify Unreal engine
3.re-install Vs2022

But then there was more to do…:
4.install MSVC 14.38 - 17.8 and uninstall MSVC latest as described above
5.right click on the .uproject file and select “Generate Visual Studio project files”,
6.open the generated .sln and rebuild the project inside Visual Studio.
7.start your project by clicking on the .uproject file, in my project it asked me to rebuild missing stuff, i clicked yes.

I did not have to comment any #if/#elif

1 Like

I have summarized some recent issues and solutions that have arisen due to the update of VS2022.

1、 Unable to create C++project; C++compiled project suddenly encountered a compilation error… Do not use NuNet Manager to fix warning vulnerabilities. Once fixed, uninstall VS2022 and reinstall it. Ignore NuGet warning prompts after reinstallation. Verify UE.

2、 UE5.2 UE5.3 cannot be packaged, prompt message appears“ Detected compiler newer than Visual Studio 2022, please update min version checking in WindowsPlatformCompilerSetup.h“

(1). Open Visual Studio installer ->Modify ->individual components to install individual components separately. Install early versions of MSVC, and the highest packaged compiled version of UE5.2 is MSVC 14.36.32532

(2). Modify the configuration file ‘% appdata% \ Unreal Engine \ Unreal BuildTool \ BuildConfiguration. xml’


<?xml version="1.0" encoding="utf-8" ?>

<Configuration xmlns=" https://www.unrealengine.com/BuildConfiguration ">

<WindowsPlatform>

<CompilerVersion>14.36.32532</CompilerVersion>

<ToolchainVersion>14.36.32532</ToolchainVersion>

</WindowsPlatform>

</Configuration>

Then save it.

2 Likes

Thanks for the reply!

I tried to fix the compilation for the 5.4 with the latest visual studio distribution.

The project generation is working again after adapting BuildConfiguration.xml in this way:

<?xml version="1.0" encoding="utf-8" ?>
<Configuration xmlns="https://www.unrealengine.com/BuildConfiguration">
	<WindowsPlatform>
		<CompilerVersion>14.42.34433</CompilerVersion>
		<ToolchainVersion>14.42.34433</ToolchainVersion>
	</WindowsPlatform>
</Configuration>

At the end of the project creation, i get this error code:

Running C:/Program Files/Epic Games/UE_5.4/Engine/Build/BatchFiles/Build.bat Development Win64 -Project="C:/Users/frank/Documents/Unreal Projects/MyProject/MyProject.uproject" -TargetType=Editor -Progress -NoEngineChanges -NoHotReloadFromIDE
Using bundled DotNet SDK version: 6.0.302
Running UnrealBuildTool: dotnet "..\..\Engine\Binaries\DotNET\UnrealBuildTool\UnrealBuildTool.dll" Development Win64 -Project="C:/Users/frank/Documents/Unreal Projects/MyProject/MyProject.uproject" -TargetType=Editor -Progress -NoEngineChanges -NoHotReloadFromIDE
Log file: C:\Users\frank\AppData\Local\UnrealBuildTool\Log.txt
Available x64 toolchains (2):
 * C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.42.34433
    (Family=14.42.34433, FamilyRank=5, Version=14.42.34433, Is64Bit=True, ReleaseChannel=Latest, Architecture=x64)
 * C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.38.33130
    (Family=14.38.33130, FamilyRank=0, Version=14.38.33143, Is64Bit=True, ReleaseChannel=Latest, Architecture=x64)
Visual Studio 2022 compiler version 14.42.34433 is not a preferred version. Please use the latest preferred version 14.38.33130
Available x64 toolchains (2):
 * C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.42.34433
    (Family=14.42.34433, FamilyRank=5, Version=14.42.34433, Is64Bit=True, ReleaseChannel=Latest, Architecture=x64)
 * C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.38.33130
    (Family=14.38.33130, FamilyRank=0, Version=14.38.33143, Is64Bit=True, ReleaseChannel=Latest, Architecture=x64)
Visual Studio 2022 compiler version 14.42.34433 is not a preferred version. Please use the latest preferred version 14.38.33130
Creating makefile for MyProjectEditor (no existing makefile)
Available x64 toolchains (2):
 * C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.42.34433
    (Family=14.42.34433, FamilyRank=5, Version=14.42.34433, Is64Bit=True, ReleaseChannel=Latest, Architecture=x64)
 * C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.38.33130
    (Family=14.38.33130, FamilyRank=0, Version=14.38.33143, Is64Bit=True, ReleaseChannel=Latest, Architecture=x64)
Visual Studio 2022 compiler version 14.42.34433 is not a preferred version. Please use the latest preferred version 14.38.33130
Available x64 toolchains (2):
 * C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.42.34433
    (Family=14.42.34433, FamilyRank=5, Version=14.42.34433, Is64Bit=True, ReleaseChannel=Latest, Architecture=x64)
 * C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.38.33130
    (Family=14.38.33130, FamilyRank=0, Version=14.38.33143, Is64Bit=True, ReleaseChannel=Latest, Architecture=x64)
Visual Studio 2022 compiler version 14.42.34433 is not a preferred version. Please use the latest preferred version 14.38.33130
@progress push 5%
Parsing headers for MyProjectEditor
  Running Internal UnrealHeaderTool "C:\Users\frank\Documents\Unreal Projects\MyProject\MyProject.uproject" "C:\Users\frank\Documents\Unreal Projects\MyProject\Intermediate\Build\Win64\MyProjectEditor\Development\MyProjectEditor.uhtmanifest" -WarningsAsErrors -installed
Total of 0 written
Reflection code generated for MyProjectEditor in 0.8554878 seconds
@progress pop
Building MyProjectEditor...
Using Visual Studio 2022 14.42.34433 toolchain (C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.42.34433) and Windows 10.0.22621.0 SDK (C:\Program Files (x86)\Windows Kits\10).
Warning: Visual Studio 2022 compiler is not a preferred version
Determining max actions to execute in parallel (24 physical cores, 32 logical cores)
  Executing up to 24 processes, one per physical core
  Requested 1.5 GB memory per action, 14.92 GB available: limiting max parallel actions to 9
Using Parallel executor to run 6 action(s)
------ Building 6 action(s) started ------
[1/6] Resource Default.rc2
C:/Users/frank/AppData/Local/UnrealEngine/Common/DerivedDataCache: Maintenance finished in +00:00:00.000 and deleted 0 files with total size 0 MiB and 0 empty folders. Scanned 0 files in 1 folders with total size 0 MiB.
[2/6] Compile [x64] SharedPCH.UnrealEd.Project.ValApi.Cpp20.cpp
C:\Program Files\Epic Games\UE_5.4\Engine\Source\Runtime\Core\Public\Experimental\ConcurrentLinearAllocator.h(31): error C4668: '__has_feature' is not defined as a preprocessor macro, replacing with '0' for '#if/#elif'
C:\Program Files\Epic Games\UE_5.4\Engine\Source\Runtime\Core\Public\Experimental\ConcurrentLinearAllocator.h(31): error C4067: unexpected tokens following preprocessor directive - expected a newline
C:\Program Files\Epic Games\UE_5.4\Engine\Source\Runtime\Engine\Classes\Engine\SkeletalMesh.h(930): warning C4996: 'FBoneMirrorInfo': FBoneMirrorInfo is deprecated. Please use UMirrorDataTable for mirroring support. Please update your code to the new API before upgrading to the next release, otherwise your project will no longer compile.
Total time in Parallel executor: 26.78 seconds
Total execution time: 34.04 seconds

it seems clear that 5.4 is not compliant with the 14.42.34433 toolchain.

When trying to compile with VS, i get warning saying

Visual Studio 2022 compiler version 14.42.34433 is not a preferred version. Please use the latest preferred version 14.38.33130

I’ll try that

And that’s a win.

Steps:

  • Install Unreal 5.4.4
  • Install VisualStudio 17.12 for unreal (.Net desktop dev, Desktop dev C++, Windows app dev, Game dev C++)
  • Extra components :
    • Compilers, build tools:
      • MVSC v143 - VS 2022 ARM build tools (v14.38 - 17.8)
      • MVSC v143 - VS 2022 ARM64/ARM64EC build tools (v14.38 - 17.8)
      • MVSC v143 - VS 2022 x64/x86 build tools (v14.38 - 17.8)
    • SDKs, libraries:
      • C++ v14.38 (17.18) ALT for v143 build tools (x86 & x64)
      • C++ v14.38 (17.18) MFC for v143 build tools (x86 & x64)
        (the extar libs can also be installed automatically once you open VS and click on the notification “Install extar module for your project” at the top right corner)
  • locate % appdata%\Unreal Engine\Unreal BuildTool\BuildConfiguration. xml and force the compiler configuration with these lines:
<?xml version="1.0" encoding="utf-8" ?>
<Configuration xmlns="https://www.unrealengine.com/BuildConfiguration">
	<WindowsPlatform>
		<CompilerVersion>14.38.33130</CompilerVersion>
		<ToolchainVersion>14.38.33130</ToolchainVersion>
	</WindowsPlatform>
</Configuration>

thanks a lot to @villinx for the explanations!

10 Likes

Thanks for solving the problem.

1 Like

@frankiezafe Just wondering about which Microsoft SDK version you were running. For 5.4.4 I was seeing somewhere that it was tested under Win10 SDK 10.0.18362, but I’m seeing since 5.5 came out they are requiring at least 10.0.19041.0.

Since this is a hit on google, for anyone else looking, don’t bother with reinstalling modules and such.
Go to your project.target.cs file, usually in the source folder and get the file.
In it, set the DefaultBuildSettings = BuildSettingsVersion.Latest;
instead of V2, V3, V4, V5, etc.

I wasted over a day reinstalling VS 2022, MSVC and playing with a bunch of nonsense.
This will fix it.

Try this first.

(post deleted by author)

Well, not at my end in a Win10 VM with UE 5.4.4 — what you describe was already so in place in that very file, the prob still occurs though…

Finally, this worked! Out of curiosity, with all these version numbers, A) how did you figure out which one to get and B) how did you figure out the build component number of the version number (the 33130 part)? I couldn’t find where that was located.

Didn’t work for me either