Include and Link error with FDynamicMesh3

Greetings,

I am trying to use Unreal for creating and editing meshes at runtime. For this purpose i use classes like UDynamicMesh, UDynamicMeshComponent and FDynamicMesh3. I wrote a small class that has a TObjectPtr object and 4 methods, 3 empty and one with some functionality.

I added following includes.

#include “Generators/MeshShapeGenerator.h”
#include “Components/DynamicMeshComponent.h”
#include “UDynamicMesh.h”
#include “DynamicMesh3.h”

And the next modules to build.cs file.

PublicDependencyModuleNames.AddRange(new string[]
{
“Core”,
“CoreUObject”,
“Engine”,
“InputCore”,
“ProceduralMeshComponent”,
“GeometryFramework”,
“DynamicMesh”
});

But, when i compile i get this error.

“Cannot open include file: ‘DynamicMesh3.h’: No such file or directory”

Trying to fix this error I add the following paths to my project properties (Configuration Properties → Include directories).

…\Engine\Intermediate\Build\Win64\UnrealEditor\Development\GeometryFramework
…\Engine\Intermediate\Build\Win64\UnrealEditor\Inc\GeometryFramework
…\Engine\Intermediate\Build\Win64\UnrealGame\Development\GeometryCore
…\Engine\Intermediate\Build\Win64\UnrealEditor\Development\GeometryCore
…\Engine\Source\Runtime\GeometryCore\Public\DynamicMesh

When i compile one time again i get the next error.

|Error|LNK2019|unresolved external symbol __declspec(dllimport) public: bool __cdecl UE::Geometry::FDynamicMesh3::IsClosed(void)const (_imp?IsClosed@FDynamicMesh3@Geometry@UE@@QEBA_NXZ) referenced in function public: void __cdecl AWorkOrderActor::ChangeMesh(class UE::Geometry::FMeshShapeGenerator const &) (?ChangeMesh@AWorkOrderActor@@QEAAXAEBVFMeshShapeGenerator@Geometry@UE@@@Z)|ProjectReal|D:\Projects\Unreal5\ProjectReal\Intermediate\ProjectFiles\WorkOrderActor.cpp.obj|1||

I am a bit lost at this point, Any of you guys can bring me some light in this topic?

2 Likes

¿?

I had to add last three lines at public dependencies modules in [project].build.cs

PublicDependencyModuleNames.AddRange(new string[] 
{ 
	"Core", 
	"CoreUObject", 
	"Engine", 
	"InputCore", 
	"ProceduralMeshComponent", 
	"GeometryFramework",
	"GeometryCore",
	"DynamicMesh"
});

I hope this could help others in my same position.
Greetings.

7 Likes