I want to separate interface and class file like Pimpl pattern.
In “TestObject.h”, class code is like this,
class ITestObject
{
public:
virtual void DoSomething() = 0;
};
and In “TestObjectImpl.h”, class code is like this,
#include "TestObject.h"
#include "TestObjectImpl.generated.h"
UCLASS()
class UTestObject : public UObject, public ITestObject
{
GENERATED_BODY()
public:
void DoSomething() override {}
};
Then, this kinds of error occur.
Class ‘UTestObject’ contains a dependency (#include or base class) to itself.
I found a similar question at here.
I guess it’s some magic of UHT, but I don’t know how to workaround.