Error (C2248) while compiling blank project with Unreal 5.3.2

Hey,

I’ve started using Unreal Engine on the 5.3.2 version, and when creating a blank C++ game, i’m getting the following :

[1/6] Compile [x64] SharedPCH.Engine.Cpp20.cpp
C:\Program Files\Epic Games\UE_5.3\Engine\Source\predefined C++ types (compiler internal)(420): error C2248: 'FHazardPointerCollection::FHazardRecord::FHazardRecord'? impossible d'acc?der ? private membre d?clar?(e) dans la classe 'FHazardPointerCollection::FHazardRecord'
C:\Program Files\Epic Games\UE_5.3\Engine\Source\Runtime\Core\Public\Experimental\Containers\HazardPointer.h(86): note: voir la d?claration de 'FHazardPointerCollection::FHazardRecord::FHazardRecord'
C:\Program Files\Epic Games\UE_5.3\Engine\Source\Runtime\Core\Public\Experimental\Containers\HazardPointer.h(77): note: voir la d?claration de 'FHazardPointerCollection::FHazardRecord'
C:\Program Files\Epic Games\UE_5.3\Engine\Source\predefined C++ types (compiler internal)(420): note: le contexte d'instanciation du mod?le (le plus ancien) est
C:\Program Files\Epic Games\UE_5.3\Engine\Source\Runtime\Core\Public\Experimental\Containers\HazardPointer.h(133): note: voir la r?f?rence ? l'instanciation de la fonction mod?le 'void __builtin_array_init_helper<FHazardPointerCollection::FHazardRecord>(_T *,size_t) noexcept(<expr>)' en cours de compilation
        with
        [
            _T=FHazardPointerCollection::FHazardRecord
        ]
[2/6] Resource Default.rc2

Do someone have a similar problem ? I’ve done nothing yet on my computer except installing the 2022 free version of VS.

Thanks

7 Likes

Hey,

I have a similar problem. I have no fix.

My fix for now is commenting the 86 line out:

	std::atomic<uintptr_t> Hazard{ FreeHazardEntry };
	//FHazardRecord() = default;

I just ran into this issue as well after updating to VS2022 17.9.0. Looks like a bug in the MSVC compiler included with that build. Some have rolled back to latest 17.8.x or done something similar to previous post or making it public:

Details here:
https://developercommunity.visualstudio.com/t/VS-2022-1790-Preview-10-__builtin_arr/10519788?sort=newest&ftype=problem

1 Like

Couldn’t rollback from 17.9.1 to 17.8.x (only to 17.9.0), but update to 17.10 Preview solved it.

4 Likes

I validate the issue in 17.9.1 and I also validate that the update to 17.10 fixes the problem.

2 Likes

I validate as well the issue with 17.9.3. Commenting the default constructor of FHazardRecord solve the problem anyways like said Tomza. Thanks to him.