# Failure to create a new project: "cannot access private member declared in class 'FHazardPointerCollection::FHazardRecord'"

**URL:** <https://forums.unrealengine.com/t/failure-to-create-a-new-project-cannot-access-private-member-declared-in-class-fhazardpointercollection-fhazardrecord/1548295>\
**Category:** Getting Started & Setup\
**Tags:** unreal-engine, bug-report, CPP, question\
**Created:** [December 23, 2023, 3:18pm UTC](https://forums.unrealengine.com/t/failure-to-create-a-new-project-cannot-access-private-member-declared-in-class-fhazardpointercollection-fhazardrecord/1548295 "2023-12-23T15:18:19Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![LuckyStarr1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@LuckyStarr1](https://forums.unrealengine.com/u/LuckyStarr1)\
**Post date:** [December 23, 2023, 3:18pm UTC](https://forums.unrealengine.com/t/failure-to-create-a-new-project-cannot-access-private-member-declared-in-class-fhazardpointercollection-fhazardrecord/1548295/1 "2023-12-23T15:18:19Z")

</div>

Hi, I’ve never worked with UE before, just installed UE 5.3.2. Trying to create a new project, I select “Games” - “First person”, then I select C++/Desktop/Scalable quality. I also ticked “Starter content”, and no raytracing. Now click “Create” - it works for a while and throws this compilation error.

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/9/0/1/9015722cbc8f87b61fb44cc729d3814f3f453786.png)

Any advice?

---

<div class="post-metadata">

**Author:** ![michaelkdaw](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@michaelkdaw](https://forums.unrealengine.com/u/michaelkdaw)\
**Post date:** [December 27, 2023, 9:03pm UTC](https://forums.unrealengine.com/t/failure-to-create-a-new-project-cannot-access-private-member-declared-in-class-fhazardpointercollection-fhazardrecord/1548295/2 "2023-12-27T21:03:29Z")

</div>

Getting this as well. Wish Epic tested their software _before_ publishing it.

---

<div class="post-metadata">

**Author:** ![ignaPuppy](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ignaPuppy](https://forums.unrealengine.com/u/ignaPuppy)\
**Post date:** [December 28, 2023, 2:16pm UTC](https://forums.unrealengine.com/t/failure-to-create-a-new-project-cannot-access-private-member-declared-in-class-fhazardpointercollection-fhazardrecord/1548295/3 "2023-12-28T14:16:30Z")

</div>

Hello I have been experiencing this problem, the problem was (for me) installing the preview version of visual studio so i just uninstalled it and reinstalled the normal version

---

<div class="post-metadata">

**Author:** ![LuckyStarr1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@LuckyStarr1](https://forums.unrealengine.com/u/LuckyStarr1)\
**Post date:** [December 29, 2023, 6:12pm UTC](https://forums.unrealengine.com/t/failure-to-create-a-new-project-cannot-access-private-member-declared-in-class-fhazardpointercollection-fhazardrecord/1548295/4 "2023-12-29T18:12:52Z")

</div>

Oh yes, I do have the Preview version of VS 2022, and switching to regular version is no-go!

P. S. I initially thought the problem is that Preview resides in its own separate subfolder, but this isn’t it, because clearly the compiler was found and invoked, it just didn’t like UE’s code.

---

<div class="post-metadata">

**Author:** ![LuckyStarr1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@LuckyStarr1](https://forums.unrealengine.com/u/LuckyStarr1)\
**Post date:** [January 3, 2024, 12:34pm UTC](https://forums.unrealengine.com/t/failure-to-create-a-new-project-cannot-access-private-member-declared-in-class-fhazardpointercollection-fhazardrecord/1548295/5 "2024-01-03T12:34:59Z")

</div>

I also have a regular (non-Preview) Community version of VS 2019 installed alongside the 2022, is there a way to tell UE 5 to use VS 2019?

---

<div class="post-metadata">

**Author:** ![dhoepcke](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/dhoepcke/32/88714_2.png) [@dhoepcke](https://forums.unrealengine.com/u/dhoepcke)\
**Post date:** [February 14, 2024, 2:20pm UTC](https://forums.unrealengine.com/t/failure-to-create-a-new-project-cannot-access-private-member-declared-in-class-fhazardpointercollection-fhazardrecord/1548295/6 "2024-02-14T14:20:09Z")

</div>

This is broken in the Visual Studio 17.9 update. If you roll back to 17.8 you should be ok.

> **[Visual Studio 2022 Release History](https://learn.microsoft.com/en-us/visualstudio/releases/2022/release-history)**
>
> A list of released versions, build numbers, and release links for Visual Studio 2022.

---

<div class="post-metadata">

**Author:** ![muspellpete](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@muspellpete](https://forums.unrealengine.com/u/muspellpete)\
**Post date:** [February 14, 2024, 3:35pm UTC](https://forums.unrealengine.com/t/failure-to-create-a-new-project-cannot-access-private-member-declared-in-class-fhazardpointercollection-fhazardrecord/1548295/7 "2024-02-14T15:35:38Z")

</div>

I also experienced this error message, though in the context of opening an Unreal 5.3 project pulled from source control.

The solution for me was adding the modules “Game development with C++” as well as “Desktop development with C++” for Visual Studio 2022. After installing only the first module and opening the project in Visual Studio I was prompted to install the second one.

---

<div class="post-metadata">

**Author:** ![JWK\_00](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@JWK\_00](https://forums.unrealengine.com/u/JWK_00)\
**Post date:** [February 14, 2024, 5:53pm UTC](https://forums.unrealengine.com/t/failure-to-create-a-new-project-cannot-access-private-member-declared-in-class-fhazardpointercollection-fhazardrecord/1548295/8 "2024-02-14T17:53:21Z")

</div>

i cant find how to return 17.8 can u help me pls…

---

<div class="post-metadata">

**Author:** ![xchimera](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@xchimera](https://forums.unrealengine.com/u/xchimera)\
**Post date:** [February 14, 2024, 7:38pm UTC](https://forums.unrealengine.com/t/failure-to-create-a-new-project-cannot-access-private-member-declared-in-class-fhazardpointercollection-fhazardrecord/1548295/9 "2024-02-14T19:38:16Z")

</div>

Open the Visual Studio Installer, next to your Visual Studio install press the More button then press rollback to previous version

---

<div class="post-metadata">

**Author:** ![Roi\_Danton](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Roi\_Danton](https://forums.unrealengine.com/u/Roi_Danton)\
**Post date:** [February 14, 2024, 8:12pm UTC](https://forums.unrealengine.com/t/failure-to-create-a-new-project-cannot-access-private-member-declared-in-class-fhazardpointercollection-fhazardrecord/1548295/10 "2024-02-14T20:12:23Z")

</div>

This is the bug report on VS community, please support that ticket there: [Developer Community](https://developercommunity.visualstudio.com/t/VS-2022-1790-Preview-10-__builtin_arr/10519788)

---

<div class="post-metadata">

**Author:** ![GameDev50](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@GameDev50](https://forums.unrealengine.com/u/GameDev50)\
**Post date:** [February 14, 2024, 8:42pm UTC](https://forums.unrealengine.com/t/failure-to-create-a-new-project-cannot-access-private-member-declared-in-class-fhazardpointercollection-fhazardrecord/1548295/11 "2024-02-14T20:42:44Z")

</div>

Not seeing that option in my Visual Studio Installer.

 ![Screenshot 2024-02-14 121430](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/3/0/d30a67c6753229a82b15b47c35e275433a39ec4d.png)

---

<div class="post-metadata">

**Author:** ![xchimera](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@xchimera](https://forums.unrealengine.com/u/xchimera)\
**Post date:** [February 14, 2024, 9:22pm UTC](https://forums.unrealengine.com/t/failure-to-create-a-new-project-cannot-access-private-member-declared-in-class-fhazardpointercollection-fhazardrecord/1548295/12 "2024-02-14T21:22:07Z")

</div>

That might be because you downloaded and installed it recently, and didn’t upgrade it? To install a specific version, see the accepted answer in this thread: [https://learn.microsoft.com/en-us/answers/questions/770494/is-it-possible-to-install-a-prior-build-version-of](https://learn.microsoft.com/en-us/answers/questions/770494/is-it-possible-to-install-a-prior-build-version-of)

---

<div class="post-metadata">

**Author:** ![Roi\_Danton](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Roi\_Danton](https://forums.unrealengine.com/u/Roi_Danton)\
**Post date:** [February 14, 2024, 9:44pm UTC](https://forums.unrealengine.com/t/failure-to-create-a-new-project-cannot-access-private-member-declared-in-class-fhazardpointercollection-fhazardrecord/1548295/13 "2024-02-14T21:44:55Z")

</div>

Are you on VS 17.8.x or 17.9? (17.8.5 works) I’m also building the release branch of the github repo.

---

<div class="post-metadata">

**Author:** ![GameDev50](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@GameDev50](https://forums.unrealengine.com/u/GameDev50)\
**Post date:** [February 14, 2024, 11:15pm UTC](https://forums.unrealengine.com/t/failure-to-create-a-new-project-cannot-access-private-member-declared-in-class-fhazardpointercollection-fhazardrecord/1548295/14 "2024-02-14T23:15:24Z")

</div>

Temporary workaround is to use 17.10 Preview Community, [according to the VS Developer Community](https://developercommunity.visualstudio.com/t/VS-2022-1790-Preview-10-__builtin_arr/10519788#T-N10584712)

---

<div class="post-metadata">

**Author:** ![JWK\_00](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@JWK\_00](https://forums.unrealengine.com/u/JWK_00)\
**Post date:** [February 15, 2024, 10:57am UTC](https://forums.unrealengine.com/t/failure-to-create-a-new-project-cannot-access-private-member-declared-in-class-fhazardpointercollection-fhazardrecord/1548295/15 "2024-02-15T10:57:02Z")

</div>

this is fix the error: [Developer Community](https://developercommunity.visualstudio.com/t/VS-2022-1790-Preview-10-__builtin_arr/10519788#T-N10584750)

---

<div class="post-metadata">

**Author:** ![frankmli](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@frankmli](https://forums.unrealengine.com/u/frankmli)\
**Post date:** [February 21, 2024, 4:08am UTC](https://forums.unrealengine.com/t/failure-to-create-a-new-project-cannot-access-private-member-declared-in-class-fhazardpointercollection-fhazardrecord/1548295/16 "2024-02-21T04:08:26Z")

</div>

This is our solution for now.  
\Engine\Source\Runtime\Core\Public\Experimental\Containers\HazardPointer.h

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/8/9/689dfa33c47a953c3e7c3e9417ccd5aa03f0752e.png)

---

<div class="post-metadata">

**Author:** ![StBlueFire](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/stbluefire/32/641418_2.png) [@StBlueFire](https://forums.unrealengine.com/u/StBlueFire)\
**Post date:** [February 21, 2024, 10:54pm UTC](https://forums.unrealengine.com/t/failure-to-create-a-new-project-cannot-access-private-member-declared-in-class-fhazardpointercollection-fhazardrecord/1548295/17 "2024-02-21T22:54:19Z")

</div>

Just to wrap up this thread you have three options. I would do them in this order if you can.

**Option 1: Rollback to 17.8.x in Visual Studio**  
How To:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/e/a/0eacd4cc6b37011dcecdcb1ee36bb97ec912082b.jpeg)

Downsides:

- If you did not install 17.8 you cannot roll back to it.

**Option 2: Update to Preview Version**  
How To:  
Same as above but select “Update” Settings and select Preview instead of current.

Downsides:

- Previews can be less stable so it may have conflicts with your particular project. (This is unlikely though)

**Option 3: Make the FHazard Variable Public**

How To:  
See frankmli’s suggestion above

Downsides:

- If you do a lot of .cpp surrounding that you may write code that relies on it being public that is not supported.
- It requires an engine change and rebuild of the engine for your team.

---

<div class="post-metadata">

**Author:** ![Alan\_Sorrill](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Alan\_Sorrill](https://forums.unrealengine.com/u/Alan_Sorrill)\
**Post date:** [February 24, 2024, 6:56pm UTC](https://forums.unrealengine.com/t/failure-to-create-a-new-project-cannot-access-private-member-declared-in-class-fhazardpointercollection-fhazardrecord/1548295/18 "2024-02-24T18:56:11Z")

</div>

My UE5 setup was working perfectly. Then I decided to install copilot. It said I needed to update Visual Studio. In a grand mistake I clicked that update button. For some reason Microsoft won’t let you choose a version with community edition. Now I’m stuck running the preview edition of visual studio 2022. Other errors forced me to start compiling the engine from this fork: [https://github.com/DreamSworK/UnrealEngine/tree/a3e283c172166168f08acc007a01aa128cce10f5](https://github.com/DreamSworK/UnrealEngine/tree/a3e283c172166168f08acc007a01aa128cce10f5)  
Found here:  
[Error compiling the Automation Tool after updating Visual Studio today (Unreal 5.3.2) - #12 by Jithak](https://forums.unrealengine.com/t/error-compiling-the-automation-tool-after-updating-visual-studio-today-unreal-5-3-2/1393088/12)

---

<div class="post-metadata">

**Author:** ![Ivan3z](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Ivan3z](https://forums.unrealengine.com/u/Ivan3z)\
**Post date:** [February 29, 2024, 6:20pm UTC](https://forums.unrealengine.com/t/failure-to-create-a-new-project-cannot-access-private-member-declared-in-class-fhazardpointercollection-fhazardrecord/1548295/19 "2024-02-29T18:20:33Z")

</div>

It does work for me!! Thank you so much!!

---

<div class="post-metadata">

**Author:** ![hanworld](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@hanworld](https://forums.unrealengine.com/u/hanworld)\
**Post date:** [March 2, 2024, 9:45am UTC](https://forums.unrealengine.com/t/failure-to-create-a-new-project-cannot-access-private-member-declared-in-class-fhazardpointercollection-fhazardrecord/1548295/20 "2024-03-02T09:45:08Z")

</div>

Oh ~~~~! Good~ Nice~! I got it!

[Next page](https://forums.unrealengine.com/t/failure-to-create-a-new-project-cannot-access-private-member-declared-in-class-fhazardpointercollection-fhazardrecord/1548295.md?page=2)
