Unresolved external symbol

I need to include InstancedStaticMesh.h but I cannot make it work.
I have this simplified code:

#include "MyProject6GameModeBase.h"

#include "Components/InstancedStaticMeshComponent.h"
#include "Runtime/Engine/Private/InstancedStaticMesh.h"


void AMyProject6GameModeBase::InitGameState()
{
	UInstancedStaticMeshComponent* i = nullptr;
	i->PerInstanceRenderData->UpdateInstanceData(i, 0);
}

And I am getting this error message.

MyProject6GameModeBase.cpp.obj : error LNK2001: unresolved external symbol "public: virtual void __cdecl HInstancedStaticMeshInstance::AddReferencedObjects(class FReferenceCollector &)" (?AddReferencedObjects@HInstancedStaticMeshInstance@@UEAAXAEAVFReferenceCollector@@@Z)
MyProject6GameModeBase.cpp.obj : error LNK2019: unresolved external symbol "public: void __cdecl FStaticMeshInstanceBuffer::UpdateInstanceData(class UInstancedStaticMeshComponent *,class TArray<class TRefCountPtr<class HHitProxy>,class FDefaultAllocator> const &,int,int)" (?UpdateInstanceData@FStaticMeshInstanceBuffer@@QEAAXPEAVUInstancedStaticMeshComponent@@AEBV?$TArray@V?$TRefCountPtr@VHHitProxy@@@@VFDefaultAllocator@@@@HH@Z) referenced in function "public: void __cdecl FPerInstanceRenderData::UpdateInstanceData(class UInstancedStaticMeshComponent *,int,int,bool)" (?UpdateInstanceData@FPerInstanceRenderData@@QEAAXPEAVUInstancedStaticMeshComponent@@HH_N@Z)

Is there something that I can include or add some module depency to make this work or is this impossible to include from private file?

try cleaning your build and rebuild it

I have tried and it does not help.