As far as I know, UObjects and AActors (and derived classes) do not support template classes. The UnrealHeaderTool attempts to resolve all symbols within the header, so you’re getting those errors.
Alternatively, you can create a UInterface and related IInterface:
If you don’t like that, you can create your base class with the UCLASS specifier “Abstract”, and then include a noentry or unimplemented assertion within your methods. e.g.:
//header
#pragma once
#include "MyAbstractClass.generated.h"
UCLASS(Abstract)
class MYGAME_API UMyAbstractClass : public UObject
{
GENERATED_BODY;
public:
UMyAbstractClass();
void MyMethod();
};
//source
#include "MyAbstractClass.h"
UMyAbstractClass::UMyAbstractClass()
:
UObject()
{}
UMyAbstractClass::MyMethod()
{
unimplemented();
}
With that structure you’ll get an error thrown if any of the methods are called without being overridden. The “Abstract” specifier prevents the engine from allowing instances of the class to be created directly, but instances of derived classes remain legal.