TITLE EDIT: StaticMeshDescription to FMeshDescription
Hi,
A fairly simple issue that I’m unable to fix…
I am trying to convert procedural meshes to static meshes in c++. To do this I lifted the code present in ProceduralMeshComponentDetails.cpp and added it to my main code. When I compile, I get linker errors with FMeshDescription-
LNK2019 unresolved external symbol “__declspec(dllimport) public: __cdecl FMeshDescription::~FMeshDescription(void)” (_imp??1FMeshDescription@@QEAA@XZ) referenced in function “public: void __cdecl ARealtimeCADModelActor::DrawPrim(struct FMeshSection)” (?DrawPrim@ARealtimeCADModelActor@@QEAAXUFMeshSection@@@Z)
LNK2019 unresolved external symbol “__declspec(dllimport) public: __cdecl FMeshDescription::FMeshDescription(struct FMeshDescription &&)” (_imp??0FMeshDescription@@QEAA@$$QEAU0@@Z) referenced in function “public: void __cdecl ARealtimeCADModelActor::DrawPrim(struct FMeshSection)” (?DrawPrim@ARealtimeCADModelActor@@QEAAXUFMeshSection@@@Z)
LNK2001 unresolved external symbol “public: __cdecl FMeshDescription::~FMeshDescription(void)” (??1FMeshDescription@@QEAA@XZ)
I looked up a couple of similar posts and it appears that the issue seems to be in the build script where I need to add dependencies. So, I added the MeshDescription module to my publicdependency string in the build script as follows but the issue still persists.
Sorry, title edit. I was reading a few things that got StaticMeshDescription stuck in my head. I don’t actually use a StaticMeshDescription object anywhere. Just a FMeshDescription object that is instantiated as “FMeshDescription MeshDescription = BuildMeshDescription(AssetNode.ProcMeshComponent);”
FMeshDescription is defined in MeshDescription.h. I have two git-built versions of unreal, 4.22 and 4.25. Intellisense shows two both versions of the header. Is it possible that my project is referencing the wrong version?
The FMeshSection that I’m using is a custom defined struct that is not related to the AlembicLibrary module. I’ve not included that module and hence there should be no conflicts there
Correct module name is “MeshDescription”.
How to figure it out
Open Visual Studio, open the file, referencing undefined symbol
Ctrl-Left Mouse Click on it, and Visual studio shows you list of sources, where it is declared.
In my case it was C:\Program Files\Epic Games\UE_4.26\Engine\Source\Runtime\MeshDescription\Public\MeshDescription.h
Looking for .build.cs file near that header, I’ve found that it is MeshDescription.build.cs