visual studio shows error but code can be compiled

Hi I am just about to start coding C++ in UE4, the IDE I am using is visual studio 2017 and when I key in the code from some tutorial website it shows that the object pointer “AActor” is a incompleted class? as the picture shows, but the code pass the compiler and engine and it works in game? I wonder why it happens and can anyone give me some clue about how to fix it?