Using a class from plugin results in "unresolved external symbol"

Hi,

I’m a bit lost. I use a plugin which implements a class in the public area.

UCLASS(MinimalAPI)
class UTestClass : public UObject
{
	GENERATED_UCLASS_BODY()

public:

	int32 GiveFoo();

private:

	UPROPERTY()
	int32 Foo;
};

in cpp:

int32 UTestClass::GiveFoo()
{
	return Foo;
}

In my project I use the plugin and if I try to use the class I got unresolved external symbol. I am sure I’m missing a library include.

UMyObject::UMyObject(const FObjectInitializer& ObjectInitializer)
{
	TestClass = NewObject<UTestClass>(this);
	int32 foo = TestClass->GiveFoo();
}

unresolved external symbol “public: int __cdecl UTestClass::GiveFoo(void)” (?GiveFoo@UTestClass@@QEAAHXZ) referenced in function “private: __cdecl UMyObject::UMyObject(class FObjectInitializer const &)” (??0UMyObject@@AEAA@AEBVFObjectInitializer@@@Z)

What is the best way to get rid of the link error. By adding it to the PublicAdditionalLibraries in the Build.cs. I thought, but so far I have no luck.

Any good hint?

Regards,
Pathfinder

Hmm, maybe try adding the plugin name to the *DependencyModuleNames lists in your Build.cs?

Thx man!

The missing XXX_API was the issue and I got a better understanding. Cheers!

It didn’t work for me in UE 5.5.1