Super isn't a class or namespace name

Good evening!

I’m getting what is, apparently, the consequence of a circular dependency that I’m not catching: the compiler is complaining about the Super inside one of my method declarations, informing me that Super is not a class or a namespace name neither (error C2653). I’m not seeing the issue here, can you guys point me what’s going on here? Here are two snapshots:

Base class:

Derived class:

Thanks! :slight_smile:

I could be wrong on this but isn’t the “Super” class is defined by the UnrealHeaderTool? If so, you have to include your class’s generated header file as well.

#include FOrbitDataTask.generated.h
2 Likes

I recreated your situation and this is my solution:

To use Super::, you require a GENERATED_BODY() macro, a UCLASS() macro in front of the declaration, inheritance from UObject, and to include your generated.h file:
classes
Ignore the IntelliSense errors; it still hasn’t updated, but it compiles with no problems.

I’ve found the generated.h file doesn’t exist unless you use UObject.

1 Like

The class you’re inheriting from is an Unreal class, but it isn’t a UCLASS (UObject) or a UStruct so I don’t think you can use the GENERATED_BODY or UPROPERTY macros in your code unless you really know what you’re doing. Super is a convenience thing you get when using UStructs and UObjects, and won’t work in your case.

Just use the parent class name explicitly, like in “normal” C++. In your case that’d be FGenericTask::DoWork();

1 Like

Sorry for the delayed reply, guys. I was sick, and turned my PC on just now.

Yes, what @anonymous_user_4aa5607e1 said is true, I figured out myself in the past days (thanks to Unreal Property System (Reflection) (unrealengine.com)): I’m not using an UObject derived class, but a FNonAbandonableTask, and I should use the parent class explicit name ParentClassName::DowWork(), since UE4 doesn’t support multiple inheritance and I can’t inherite both FNonAbadonableTask and UObject (it would be a weird class thou).

You’re guys are right too, @anonymous_user_7db7de02 and @STRiFE.x, but for what I want to do, isn’t possible.

Thanks guys!