# "cannot acces private member" Error with Compiling C++ Projects in VScode

**URL:** <https://forums.unrealengine.com/t/cannot-acces-private-member-error-with-compiling-c-projects-in-vscode/1721851>\
**Category:** C++\
**Tags:** unreal-engine, crash, CPP, question\
**Created:** [March 1, 2024, 5:04am UTC](https://forums.unrealengine.com/t/cannot-acces-private-member-error-with-compiling-c-projects-in-vscode/1721851 "2024-03-01T05:04:16Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![sukigd](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/sukigd/32/904442_2.png) [@sukigd](https://forums.unrealengine.com/u/sukigd)\
**Post date:** [March 1, 2024, 5:04am UTC](https://forums.unrealengine.com/t/cannot-acces-private-member-error-with-compiling-c-projects-in-vscode/1721851/1 "2024-03-01T05:04:17Z")

</div>

![Screenshot 2024-02-29 200451](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/a/e/1aea2809c84431f7831cea416592f085c0f382bc.png)  
 ![Screenshot (2)](https://d3kjluh73b9h9o.cloudfront.net/original/4X/8/7/a/87af2e4735b0240a4dd273998b8c0d46f70894c7.png)

When I try to compile a program from the Unreal Project Browser using VScode, the progress bar loads to 90% and I receive this error message:

```auto
'FHazardPointerCollection::FHazardRecord::FHazardRecord': cannot access private member declared in class 'FHazardPointerCollection::FHazardRecord'

```

I have all necessary C++ and C# VScode extensions, all necessary VS Build Tools C++ Development and .NET extensions, all necessary C++ and .NET SDKs and MinGW installed and set to work with VScode. I get the same error when I try to compile directly from VScode. Running either application as administrator does not help.

I have followed the steps of the official site to a tee, including directions on setting up IntelliSense with Unreal, but I am unable to generate C++ projects without incurring this error and there are no video tutorials on the matter.

Any guidance would be much appreciated! I desperately don’t want to have to use Visual Studio…

Thanks!

---

<div class="post-metadata">

**Author:** ![Arodi007](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/arodi007/32/1022275_2.png) [@Arodi007](https://forums.unrealengine.com/u/Arodi007)\
**Post date:** [March 1, 2024, 5:18am UTC](https://forums.unrealengine.com/t/cannot-acces-private-member-error-with-compiling-c-projects-in-vscode/1721851/2 "2024-03-01T05:18:47Z")

</div>

From what i seen other people with visual studio are getting the same issue as well when they update to latest version.

> [@Failure to create a new project: "cannot access private member declared in class 'FHazardPointerCollection::FHazardRecord'"](https://forums.unrealengine.com/t/failure-to-create-a-new-project-cannot-access-private-member-declared-in-class-fhazardpointercollection-fhazardrecord/1548295/17):
>
> 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: 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 t…

VS code most likely using the code as visual studio i guess, you can try an older version if that can help.

---

<div class="post-metadata">

**Author:** ![sukigd](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/sukigd/32/904442_2.png) [@sukigd](https://forums.unrealengine.com/u/sukigd)\
**Post date:** [March 1, 2024, 7:05am UTC](https://forums.unrealengine.com/t/cannot-acces-private-member-error-with-compiling-c-projects-in-vscode/1721851/3 "2024-03-01T07:05:55Z")

</div>

Just downgraded my version and yup-- it works.

Thanks for the solution! From the discussion you sent me it does seem like it’s just an issue with the latest vs updates. Hopefully an easier solution comes along, or the UE devs patch it soon.

---

<div class="post-metadata">

**Author:** ![Arodi007](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/arodi007/32/1022275_2.png) [@Arodi007](https://forums.unrealengine.com/u/Arodi007)\
**Post date:** [March 1, 2024, 10:46am UTC](https://forums.unrealengine.com/t/cannot-acces-private-member-error-with-compiling-c-projects-in-vscode/1721851/4 "2024-03-01T10:46:59Z")

</div>

No worries 🤗

But it kinda sad, i believe it from microsoft end, they said it was fixed on 17.9 and even close the issue from [Developer Community](https://developercommunity.visualstudio.com/t/VS-2022-1790-Preview-10-__builtin_arr/10519788#T-N10584750) but we still having the same issue.  
The staff replied with:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/8/7/3877a6d785889e0c2fc18df540baf758b0dc041e.png)

So it suppose to be on 17.10.

Even windows update has a broken update since january for “KB5034441” am still waiting…

---

<div class="post-metadata">

**Author:** ![system](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/1/3/713c9d3f58553f0de89543d76a8a3a2779dc9fa4.png) [@system](https://forums.unrealengine.com/u/system)\
**Post date:** [March 31, 2024, 10:47am UTC](https://forums.unrealengine.com/t/cannot-acces-private-member-error-with-compiling-c-projects-in-vscode/1721851/5 "2024-03-31T10:47:32Z")

</div>

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