Error C2027: use of undefined type that doesn't exist

Hey all, I’m brand new to C++ development, though I have C# knowledge from work and some Unity hobbyism.

I’m starting to get incredibly frustrated with UE4, though. I’m trying to add a projectile to the Third Person template by picking pieces from the first person one. However, when I tried to add the projectile to my game, it wouldn’t compile - I’ve since deleted the files and removed all references to it, but I’m still getting this error! Visual Studio has been compiling just fine the entire time, but when I try to compile within the UE4 editor, it fails for thsi same reason every time. What the heck is going on?

Error C:\Program Files\Epic Games\4.7\Engine\Source\Runtime\CoreUObject\Public\UObject\Class.h(2517)  : error C2027: use of undefined type 'ADodgeballProjectile'
Info          c:\users\000\documents\unreal projects\dodgeballcpp\source\dodgeballcpp\DodgeballCPPCharacter.h(35)  : see declaration of 'ADodgeballProjectile'
Info          C:\Program Files\Epic Games\4.7\Engine\Source\Runtime\CoreUObject\Public\UObject\Class.h(2516)  : while compiling class template member function 'UClass *TSubclassOf<ADodgeballProjectile>::operator *(void) const'
Info          C:\Program Files\Epic Games\4.7\Engine\Source\Runtime\CoreUObject\Public\UObject\ObjectBase.h(1476)  : see reference to function template instantiation 'UClass *TSubclassOf<ADodgeballProjectile>::operator *(void) const' being compiled
Info          c:\users\000\documents\unreal projects\dodgeballcpp\source\dodgeballcpp\DodgeballCPPCharacter.h(35)  : see reference to class template instantiation 'TSubclassOf<ADodgeballProjectile>' being compiled
Error C:\Program Files\Epic Games\4.7\Engine\Source\Runtime\CoreUObject\Public\UObject\Class.h(2517)  : error C3861: 'StaticClass': identifier not found


The source of the error is here:


What’s on that line?


This is why it’s so confusing for me: that line is a comment.

35. /** Sound to play each time we fire */
36. UPROPERTY(EditAnywhere, BlueprintReadWrite, Category=Gameplay)
37. class USoundBase* FireSound;

That doesn’t seem possible. That error comes from the compiler (rather than the UE4 build system) and so the file is being read directly from disk. Are you sure you are looking at the right copy of the file? You don’t have a copy or anything?

c:\users\000\documents\unreal projects\dodgeballcpp\source\dodgeballcpp\DodgeballCPPCharacter.h


Thanks for looking at it Steve, I ended up just copying everything manually into a new project and it seems fine. I don’t know if it was a caching issue or what, but it’s working now.