Trying to include LandscapeEdit.h

We are trying to access heightdata from landscapes after they have been created. For this as we understand it, we can use FLandscapeEditDataInterface. But when we include LandscapeEdit.h and compile we get the following error:

D:\Unreal Engine 5\UE_5.0\Engine\Source\Runtime\Landscape\Public\LandscapeEdit.h(18): fatal error C1083: Cannot open include file: 'InstancedFoliageActor.h': No such file or directory

Including the module “Foliage”:

PrivateDependencyModuleNames.AddRange(
			new string[]
			{
				"Projects",
				"InputCore",
				"EditorFramework",
				"UnrealEd",
				"ToolMenus",
				"CoreUObject",
				"Engine",
				"Slate",
				"SlateCore",
				"Landscape",
				"Foliage",
				// ... add private dependencies that you statically link with here ...	
			}
			);

Including the module makes the engine crash during compile time, giving this error:

Unhandled Exception: EXCEPTION_ACCESS_VIOLATION 0x0000000300905a4d

ucrtbase
UnrealEditor_ProceduralWorld_patch_0!dllmain_crt_process_attach() [D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\dll_dllmain.cpp:66]
UnrealEditor_ProceduralWorld_patch_0!dllmain_dispatch() [D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\dll_dllmain.cpp:276]
UnrealEditor_LiveCoding
UnrealEditor_LiveCoding
UnrealEditor_LiveCoding
UnrealEditor_LiveCoding
ucrtbase
kernel32
ntdll

Any ideas on what might be the problem?

2 Likes

Im still stuck on this, when including LandscapeEdit.h, the compiler say that InstancedFoliageActor.h cannot be included.

Any suggestions?

I’m having the same problem. Did you find a solution?

I got the same error. I solved this by adding ‘Landscape’ and ‘Foliage’ to the PublicDependencyModule in MyProject.Build.cs. Then, I rebuilt the project.

PublicDependencyModuleNames.AddRange(
    new string[] {
        "Core",
        "CoreUObject",
        "Engine",
        "RenderCore",
        "Landscape",
        "Foliage",
    }
);
1 Like