LNK2001 in class generated by the editor

I got a lot of errors with a class generated by the editor :

error LNK2019: unresolved external
symbol “public: virtual void __cdecl
in “public:
virtual void __cdecl

the code :

AAutoLandscape.H :

#pragma once

#include "Landscape/Landscape.h"
#include "AutoLandscape.generated.h"

UCLASS(hidecategories = LandscapeProxy, showcategories = (Display, Movement, Collision, Lighting, LOD, Input))
class NIGHTWINGS_API AAutoLandscape : public ALandscape


#include "NightWings.h"
#include "AutoLandscape.h"

AAutoLandscape::AAutoLandscape(const class FPostConstructInitializeProperties& PCIP)
	: Super(PCIP)


Looks like linker cannot find definition of:

public: virtual void ALandscapeProxy::ChangeLODDistanceFactor(float)

Do you have Engine module dependency defined in yourmodule.Build.cs file ?

PrivateDependencyModuleNames.AddRange(new string[] { "Engine" });

I get the solution on IRC: class ALandscape should be class UNREAL_API ALandscape and UE must be recompiled.
There is errors when subclassing a class without UNREAL_API .

Report: succeeded in compiling landscape and landscapeEditor modules as two game play modules (not engine modules).


Overall steps : (4.22)
1.Create an empty project named myproject.
2.Copy over engine/source/runtime/landscape to myproject/source/MimicLand
3.Open in the VS, replace all occurences of “Landscape” to “MimicLand” case-sensitively. Replace LANDSCAPE_API and ENGINE_API properly.
fix build.cs and includes, and revert unwanted replacements of “Landscape” including occurences in “/Engine/EditorLandscapeResources…” from LandscapeEditor module and in structures or varibles that communicat with landscape shaders including “LandscapeProceduralPS.usf” and “LandscapeVertexFactory.ush”
4.Manage to compile the module. to compile LandscapeCollision.cpp as MimicLandCollision.cpp, a series of thirdparty includes should be added in the build.cs :

            new string[] {
                "other includings......"

5.Do the same for the LandscapeEditor module. fix dependcies in the build.cs.
6. success ! ^.^ Have to say unreal engine is wonderful and in a sense very playable itself …

Main drawbacks:

  1. Editor tool icons are lost .
  2. FLandscapeStaticLightingTextureMapping::ExportMapping and another method in the LandscapeLight.h defined in the StaticLightingExport.cpp of UnrealEd module, so in the end I think you still need to compile the entire engine …