GeometryMode gives unresolved externals error

I can’t use GeometryMode structures - every time when I define a new object of class, for example,
FEdModeGeometry from “\Editor\GeometryMode\Public\GeometryEdMode.h” header, I get unresolved externals error. I tried everything - switching Actor class preamble from MYPROJECT_API to ENGINE_API or GEOMETRYMODE_API, using external class (what is strange, I can use those constructors in some normal class, but I can’t use them in my Actor’s methods), setting plugin names in different combinations. Here is the minimal example:

In Build.cs:

PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore", "ProceduralMeshComponent", "GeometryMode" });
PrivateDependencyModuleNames.AddRange(new string[] { "GeometryMode" });

MyActor header:

#pragma once

#include "GameFramework/Actor.h"
#include "Editor/GeometryMode/Public/GeometryEdMode.h"
#include "MyActor2.generated.h"

UCLASS()
class TERRAINSANDBOX3_API AMyActor2 : public AActor
{
	GENERATED_BODY()
	
public:	
	AMyActor2();
	virtual void BeginPlay() override;
	virtual void Tick( float DeltaSeconds ) override;
	void PostEditChangeProperty(struct FPropertyChangedEvent& PropertyChangedEvent){
    	FEdModeGeometry x = FEdModeGeometry();
	    }
};

Those conditions give me the following error:

1>MyActor2.cpp.obj : error LNK2019: unresolved external symbol "public: __cdecl FEdModeGeometry::FEdModeGeometry(void)" (??0FEdModeGeometry@@QEAA@XZ) referenced in function "public: virtual void __cdecl AMyActor2::PostEditChangeProperty(struct FPropertyChangedEvent &)" (?PostEditChangeProperty@AMyActor2@@UEAAXAEAUFPropertyChangedEvent@@@Z)
1>MyActor2.cpp.obj : error LNK2019: unresolved external symbol "public: virtual __cdecl FEdModeGeometry::~FEdModeGeometry(void)" (??1FEdModeGeometry@@UEAA@XZ) referenced in function "public: virtual void __cdecl AMyActor2::PostEditChangeProperty(struct FPropertyChangedEvent &)" (?PostEditChangeProperty@AMyActor2@@UEAAXAEAUFPropertyChangedEvent@@@Z)
1>C:\UE4 Projects\TerrainSandbox3\Binaries\Win64\UE4Editor-TerrainSandbox3-4393.dll : fatal error LNK1120: 2 unresolved externals

Actually there is no error at all. First things first: You can not link against any editor code in your final build, that is against EULA. Anything that starts with Editor on include path you are out of luck. You can still use it but only for Editor builds.


Second you are missing defines for editor only functions #if WITH_EDITOR for your PostEditChangeProperty function. If you are not sure if you can use particular function just look where headed is on file path or look into API docs which usually list module name as well. If you want to use given function be sure to include that module in your Build.cs file.