Static Mesh Description linker problems

I have this constructor:

// Fill out your copyright notice in the Description page of Project Settings.

#include "CTerrain.h"
#include "Components/StaticMeshComponent.h"
#include "Engine/StaticMesh.h"
#include "StaticMeshDescription.h"

// Sets default values
 	// Set this actor to call Tick() every frame.  You can turn this off to improve performance if you don't need it.
	PrimaryActorTick.bCanEverTick = true;
	staticMeshComponent = CreateDefaultSubobject<UStaticMeshComponent>("Static Mesh Component");
	UStaticMesh* mesh = staticMeshComponent->GetStaticMesh();
	meshDescription = mesh->CreateStaticMeshDescription(this);

With this header file:

// Fill out your copyright notice in the Description page of Project Settings.

#pragma once
#include "CoreMinimal.h"
#include "GameFramework/Actor.h"

#include "CTerrain.generated.h"

class MYPROJECT3_API ACTerrain : public AActor
	// Sets default values for this actor's properties

	void GenerateFlatLand(uint32 sizeX, uint32 sizeY);
	// Called when the game starts or when spawned
	virtual void BeginPlay() override;
	void ModifyTile(uint32 x, uint32 y, TArray<uint32> heights);
	uint32 GetIndexFromCoords(uint32 x, uint32 y);
	FVector2D GetCoordsFromIndex(uint32 index);

	class UStaticMeshComponent* staticMeshComponent;
	class UStaticMeshDescription* meshDescription;

	uint32 mapWidth;
	uint32 mapHeight;
	uint32 gridSize;
	// Called every frame
	virtual void Tick(float DeltaTime) override;


I get a linking error on meshDescription->CreateVertex();.

Severity	Code	Description	Project	File	Line	Suppression State
Error	LNK2019	unresolved external symbol "__declspec(dllimport) public: struct FVertexID __cdecl UMeshDescriptionBase::CreateVertex(void)" (__imp_?CreateVertex@UMeshDescriptionBase@@QEAA?AUFVertexID@@XZ) referenced in function "public: __cdecl ACTerrain::ACTerrain(void)" (??0ACTerrain@@QEAA@XZ)	MyProject3	C:\Users\lucas\OneDrive\Documents\Unreal Projects\MyProject3\Intermediate\ProjectFiles\CTerrain.cpp.obj	1	

Do you have any indication on how to fix this error?

Add “MeshDescription” to your Build.cs file

PrivateDependencyModuleNames.AddRange(new string[]
     // ....
     // ....

You might also want to add “StaticMeshDescription”

A good way to determine this is open up the file in explore and look at the path. Here’s the path for the filename that contains the mesh description class:

If you go up the chain, you’ll see that it resides in a module called MeshDescription: