Download

Help: Implementation About PURE_VIRTUAL Macro

I try to implement abstract method on my abstract class.

I get this error : “…error LNK2001: unresolved external symbol…”

UCLASS(Abstract)
class PROJECT_API AbstractClassBase : public UObject
{
...

public:
virtual void MethodA() PURE_VIRTUAL(AbstractClassBase::MethodA,);
virtual void MethodB() PURE_VIRTUAL(AbstractClassBase::MethodB,);
virtual void MethodC() PURE_VIRTUAL(AbstractClassBase::MethodC,);

Here’s my code.

You should include the full error text.

UCLASS(Abstract)
class PROJECT_API AbstractClassBase : public UObject
{
...

public:
virtual void MethodA() PURE_VIRTUAL(AbstractClassBase::MethodA, "Error message");
virtual void MethodB() PURE_VIRTUAL(AbstractClassBase::MethodB, "Error message");
virtual void MethodC() PURE_VIRTUAL(AbstractClassBase::MethodC, "Error message");

Like this? I don’t get it.Can you write me an example please.

no, he’s asking for the complete text of the linker error.

i looked this up briefly, and i did see one person say you can’t use pure_virtual in uobject, but i suspect that’s a mistake. Personally, I’ve had very little use for abstracts and pure virtuals in my years with unreal.

No. You’ve omitted text from the linker error that you’ll need to give us to get any help.