USteamVRChaperoneComponent::GetBounds() in c++ cause a link error.

Hello everyone.

I try to use USteamVRChaperoneComponent::GetBounds() from SteamVR plugin in my c++ project, but always get link error when build with Development Editor x64. But in Unreal Editor, I can use GetBounds normally in a Blueprint. Why?

My code and error is shown below:

in “.h”:

UPROPERTY(VisibleAnywhere, BlueprintReadOnly, meta = (AllowPrivateAccess = true))
USteamVRChaperoneComponent* SteamVRChaperone;

in “.cpp”:

SteamVRChaperone = CreateDefaultSubobject(TEXT(“SteamVRChaperone”));

// Test

int n = SteamVRChaperone->GetBounds().Num();

link error:

error LNK2019: unresolved external symbol "public: class TArray __cdecl USteamVRChaperoneComponent::GetBounds(void)const " (?GetBounds@USteamVRChaperoneComponent@@QEBA?AV?$TArray@UFVector@@VFDefaultAllocator@@@@XZ) referenced in function “public: void __cdecl AMotionControllerActor::SetupRoomScaleOutline(void)” (?SetupRoomScaleOutline@AMotionControllerActor@@QEAAXXZ)

I’m totally sure I already add the “SteamVR” module dependency in “xxx.build.cs”.
Anyone knows why?
Is there missing something in the SteamVR built-in version library?

Someone could post an answer here pretty please?

See https://github.com/EpicGames/UnrealEngine/pull/2880

It looks like they have not exposed that function in C++, only blueprints. Look at this pull request - https://github.com/EpicGames/UnrealEngine/pull/2880 as NeroProtagonist said. You can use a custom engine with those changes shown in the pull request until Epic adds it to the engine.