UINTERFACE(MinimalAPI,BlueprintType, meta = (CannotImplementInterfaceInBlueprint))
class UTestInterface : public UInterface
{
GENERATED_BODY()
};
class TEST_API ITestInterface
{
GENERATED_BODY()
};
UCLASS(NotBlueprintable, NotBlueprintType)
class TEST_API UTestInterfaceImpl : public UObject, public ITestInterface
{
GENERATED_BODY()
}
I place UTestInterface,UTestInterface and UTestInterfaceImpl in one header, and the UHT says:“error : Class ‘UTestInterface’ contains a dependency (#include or base class) to itself”,After I move UTestInterfaceImpl to another file,there have no error anymore.
At first, I think it is because UBT doesn’t allow to do this, but I find UHT allow the user to place multiple UCLASS declarations in one header.
So I’m confused. Why Multiple UClass is OK, but UInterface can’t do the same thing?
error : Class ‘TestA’ contains a dependency (#include or base class) to itself
After I Move the declaration of TestAImpl to TestAImpl.h,It successfully compiled, I don’t even change any include in TestA.h(TestAImpl.h include TestA.h)
The error seems to go away for me if I delete UTestInterface. Do you need to interact with the interface from Blueprint, or are your implementations of the interface only for use by C++ (as in the case of UTestInterfaceImpl)?
I looked internally, and this bug has already been reported and is currently assigned to a developer. In the meantime, it seems like the only workaround is to split up the interface and the class that implements it.