Incomplete type 'ATankPlayerController' named in nested name specifier

Hi there! I have been doing the Battle Tanks game tutorial using my Mac with XCode 11.5 and UE4.25. I keep seeing this error in all my cpp files where I implement any method. For example for the ATankPlayerController I have declared the method ATank* GetControlledTank() const; in the header file and implemented it in the cpp file. But when I build the project, I see the following error:

“Incomplete type ‘ATankPlayerController’ named in nested name specifier” on the definition of the method: ATank* ATankPlayerController::GetControlledTank() const {}. However, it says the build has succeeded and Unreal does detect the Hot reload successfully.

But I am not sure why this error is displaying on all my method implementations. Any ideas?.

Any help will be much appreciated! Thanks :slight_smile:

Have you tried refreshing the code project in Unreal? File > Refresh Code Project

Yes I have tried to refresh the project and also tried to completely delete the xcode project file and regenerate it. But no luck with it unfortunately:(