Compile error following QuickStart Unreal Tutorial

Hey,

I’m following Unreal Engine CPP Quick Start | Unreal Engine 5.1 Documentation Using Visual Studio Community (2019 - 16.4.1), UE 4.24 and .net SDK 4.8

I get the following error after step 4 (adding the code to the floating cpp):

This error doesn’t actually break compilation, seems to just be an intellisense issue, however if I add #include “Components/StaticMeshComponent.h” the error dissapears.

Does the unreal tutorial just miss out the instruction to add the include? Or can I configure my VS in such a way where intellisense won’t error for this?

Thanks in advance

theres a header you have to include in the .cpp. they havent updated the walkthrough in a long time i guess because i am getting errors left and right when i am trying to follow along.
Anyhow the one for that specific error is “UObject/Components/StaticMeshComponent.h”

Ive got the same issue, and I didnt find any solution yet.

I’ve received an answer from @zmaj666 and it really works, hope it helps.