Hi, I keep having this error while live coding and I have no idea what is the issue here, did anyone face such a problem

Running D:\UE_5.3\Engine\Build\BatchFiles\Build.bat -Target=“CryptRiderEditor Win64 Development -Project=”“D:/UE_5.3/CryptRider/CryptRider.uproject”“” -LiveCoding -LiveCodingModules=“D:/UE_5.3/Engine/Intermediate/LiveCodingModules.json” -LiveCodingManifest=“D:/UE_5.3/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=“CryptRiderEditor Win64 Development -Project=”“D:/UE_5.3/CryptRider/CryptRider.uproject”“” -LiveCoding -LiveCodingModules=“D:/UE_5.3/Engine/Intermediate/LiveCodingModules.json” -LiveCodingManifest=“D:/UE_5.3/Engine/Intermediate/LiveCoding.json” -WaitMutex -LiveCodingLimit=100
Quick restart disabled when re-instancing is enabled.
Log file: C:\Users\jaber\AppData\Local\UnrealBuildTool\Log.txt
Building CryptRiderEditor…
Using Visual Studio 2022 14.39.33218 toolchain (D:\vs\VC\Tools\MSVC\14.39.33218) and Windows 10.0.22621.0 SDK (C:\Program Files (x86)\Windows Kits\10).
Determining max actions to execute in parallel (6 physical cores, 12 logical cores)
Executing up to 6 processes, one per physical core
Requested 1.5 GB memory per action, 7.63 GB available: limiting max parallel actions to 5
------ Building 19 action(s) started ------
[1/19] Compile [x64] SharedPCH.Engine.Cpp20.cpp
D:\UE_5.3\Engine\Source\predefined C++ types (compiler internal)(420): error C2248: ‘FHazardPointerCollection::FHazardRecord::FHazardRecord’: cannot access private member declared in class ‘FHazardPointerCollection::FHazardRecord’
D:\UE_5.3\Engine\Source\Runtime\Core\Public\Experimental\Containers\HazardPointer.h(86): note: see declaration of ‘FHazardPointerCollection::FHazardRecord::FHazardRecord’
D:\UE_5.3\Engine\Source\Runtime\Core\Public\Experimental\Containers\HazardPointer.h(77): note: see declaration of ‘FHazardPointerCollection::FHazardRecord’
D:\UE_5.3\Engine\Source\predefined C++ types (compiler internal)(420): note: the template instantiation context (the oldest one first) is
D:\UE_5.3\Engine\Source\Runtime\Core\Public\Experimental\Containers\HazardPointer.h(133): note: see reference to function template instantiation ‘void __builtin_array_init_helperFHazardPointerCollection::FHazardRecord(_T *,size_t) noexcept()’ being compiled
with
[
_T=FHazardPointerCollection::FHazardRecord
]
Total time in Parallel executor: 42.84 seconds
Total execution time: 53.13 seconds
Build failed.

4 Likes

error while live coding

The first thing i’d like to clarify: is this error only present during livecoding compilation? In general case with errors like cannot access private member it should not compile at all

no also when i try to compile from vs code i get this: Executing task in folder UE5: dotnet build --configuration Development D:\UE_5.3\Engine\Source\Programs\UnrealBuildTool\UnrealBuildTool.csproj

Failed to load the dll from [C:\Program Files (x86)\dotnet\shared\Microsoft.NETCore.App\7.0.13\hostpolicy.dll], HRESULT: 0x800700C1
An error occurred while loading required library hostpolicy.dll from [C:\Program Files (x86)\dotnet\shared\Microsoft.NETCore.App\7.0.13]

  • The terminal process “C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe -Command dotnet build --configuration Development D:\UE_5.3\Engine\Source\Programs\UnrealBuildTool\UnrealBuildTool.csproj” terminated with exit code: 1.

I am also having this issue but it’s when I try to create a new project.
Did you ever manage to solve it?

A:\Epic Games\UE_5.3\Engine\Source\predefined C++ types (compiler internal)(420): error C2248: 'FHazardPointerCollection::FHazardRecord::FHazardRecord': cannot access private member declared in class 'FHazardPointerCollection::FHazardRecord'
A:\Epic Games\UE_5.3\Engine\Source\Runtime\Core\Public\Experimental\Containers\HazardPointer.h(86): note: see declaration of 'FHazardPointerCollection::FHazardRecord::FHazardRecord'
A:\Epic Games\UE_5.3\Engine\Source\Runtime\Core\Public\Experimental\Containers\HazardPointer.h(77): note: see declaration of 'FHazardPointerCollection::FHazardRecord'
A:\Epic Games\UE_5.3\Engine\Source\predefined C++ types (compiler internal)(420): note: the template instantiation context (the oldest one first) is
A:\Epic Games\UE_5.3\Engine\Source\Runtime\Core\Public\Experimental\Containers\HazardPointer.h(133): note: see reference to function template instantiation 'void __builtin_array_init_helper<FHazardPointerCollection::FHazardRecord>(_T *,size_t) noexcept(<expr>)' being compiled
        with
        [
            _T=FHazardPointerCollection::FHazardRecord
        ]
1 Like

The problem is with the latest version of Visual Studio C++ compiler (17.8 or 17.9)
Rolling back the installed compiler version will fix the problem.
You can do this in the Visual Studio installer tool selector dialog.

2 Likes

Is this problem documented somewhere?

Probably not, given that this is a fairly recent release by Microsoft that seems to break this code, and Unreal release building isn’t part of the Microsoft compiler test suite, and running with the latest version of C++ compilers isn’t something EPIC does every week.

Can you elaborate on which specific components to rollback for Visual Studio C++ compiler? Or was there some other way to choose compiler version?

I can also confirm that the latest version doesn’t work.

In the installer, click More > Rollback

it’s a hard coded rollback, it rolled me back to 17.5.3, which works for me.

1 Like

For me the fix was to install Individual Component on my Visual Studio 2022 Community:

Look for MSVC v143 VS 2022 C++ x64/x84 build tools (v14.36-17.6). I also deleted the one called (latest) but eventually installed it back.

After that I re-generated project files and reopened Unreal Engine, and Live Coding picked the right toolchain:

Using Visual Studio 2022 14.36.32545 toolchain
10 Likes

I am having the same exact error!

2 Likes

Was having the same issue with VS Build Tools 2022 Version 17.9. Fixed it by uninstalling that version and installing version 17.6 of the build tools. Thanks!

Where did you go to download the specific version? I have been looping around the same pages for Visual Studio but all I can ever seem to get downloaded is the most recent version that is 17.9

Yeah I have the same question. How to downgrade from 17.9 to 17.6?

I have been on the live chat with Mircrosoft. It looks like they do not have any location to download specific versions of releases for the free community studio. The only thing they where able to tell me was to uninstall everything and download the 2019 v16.11 and if that did not work they could not do much about it.

This link has some pointers:
https://www.google.com/search?q=How+to+downgrade+visual+c%2B%2B+compiler+from+17.9+to+17.6

That post outlines that the free community version does not have the roll back and cannot be downgraded. The only versions that you can ‘rollback’ are the Enterprise and the Professional versions.

You can fix it with just add public to the error File Variable Name:


All thanks to Arvid Nasirabadi in Developer Community

it fixed it for me. maybe not a longterm solution, but at least a workaround so you can develop :slight_smile:

5 Likes

Thanks for showing a work around! it is appreciated!

1 Like

Thanks for this.

1 Like