I ran into this same error today even though the syntax was correct after triple-checking it all over. I tried forward declarations and that did not work. I did notice that Visual Studio stopped colorizing the tags in my code, so I decided to try something that fixed other issues I’ve had…
If time isn’t a constraint, try:
- Close UE4 and Visual Studio
- Delete Binaries and Intermediate Folders
- Right-click *.uproject file and generate new Visual Studio project files
- Re-open UE4 and Visual Studio. Compile in Engine.
Worked for me as of 4.25.4