Originally posted by getnamo
View Post
In the Char.h I include "LeapController.h" and define a pointer to the component.
Code:
class ULeapController* LeapController;
Code:
ALeapCharacter::ALeapCharacter() { PrimaryActorTick.bCanEverTick = true; LeapController = CreateDefaultSubobject<ULeapController>(TEXT("LeapControllerComponent")); }
Code:
LeapCharacter.cpp.obj : error LNK2019: unresolved external symbol "private: static class UClass * __cdecl ULeapController::GetPrivateStaticClass(wchar_t const *)" (?GetPrivateStaticClass@ULeapController@@CAPEAVUClass@@PEB_W@Z) referenced in function "public: class ULeapController * __cdecl UObject::CreateDefaultSubobject<class ULeapController>(class FName,bool)" (??$CreateDefaultSubobject@VULeapController@@@UObject@@QEAAPEAVULeapController@@VFName@@_N@Z)
Edit:
It seems that adding the MinimalAPI tag for the ULeapController class fixes the compilation error to instantiate the component.
Code:
UCLASS(MinimalAPI, ClassGroup=Input, meta=(BlueprintSpawnableComponent)) class ULeapController : public UActorComponent
Example when using the EnableBackgroundTracking:
Code:
LeapCharacter.cpp.obj : error LNK2019: unresolved external symbol "public: void __cdecl ULeapController::EnableBackgroundTracking(bool)" (?EnableBackgroundTracking@ULeapController@@QEAAX_N@Z) referenced in function "public: __cdecl ALeapCharacter::ALeapCharacter(void)" (??0ALeapCharacter@@QEAA@XZ)
Code:
class LEAPMOTION_API ULeapController : public UActorComponent
Leave a comment: