10-25-2024 12:42 PM - edited 10-25-2024 12:43 PM
In my project, I'd like to write some of the functionality in C++ vs. blueprints.
However, I'm unable to get past linker errors when calling functions from the Meta XR plugin. Specifically, I'm trying to create the custom Pawn, with the Oculus Controller Component.
I've added the following to the .Build.cs file:
PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore", "EnhancedInput", "XRBase", "OculusXRInput", "OculusXRHMD" });
But adding this code (along with the relevant #include):
UOculusXRControllerComponent* MyController = CreateDefaultSubobject<UOculusXRControllerComponent>(TEXT("MotionControllerRight"));
Results in this compile error:
XRPawn.cpp.obj : error LNK2019: unresolved external symbol "private: static class UClass * __cdecl UOculusXRControllerComponent::GetPrivateStaticClass(void)" (?GetPrivateStaticClass@UOculusXRControllerComponent@@CAPEAVUClass@@XZ) referenced in function "public: __cdecl AXRPawn::AXRPawn(void)" (??0AXRPawn@@QEAA@XZ)
C:\Users\XYZ\Documents\Unreal Projects\XR_Switch\Binaries\Win64\UnrealEditor-XR_Switch.patch_0.exe : fatal error LNK1120: 1 unresolved externals
10-28-2024 08:33 PM - edited 10-28-2024 08:34 PM