Integrating OCCT to UE5.4.3 triggers module error.

My goal is integrating OCCT to Unreal Engine. Workflow will go like this. After getting vertices values, we can generate UStaticMesh with mesh descriptions or we can just create dynamic meshes. So, we can bypass opengl or any other visualization libraries.

As I understand, these are the libraries to get vertices of step file.

#include <STEPControl_Reader.hxx>
#include <BRep_Tool.hxx>
#include <TopoDS_Shape.hxx>
#include <TopoDS_Iterator.hxx>
#include <TopoDS_Vertex.hxx>
#include <TopExp_Explorer.hxx>
#include <gp_Pnt.hxx>

These require TKernel.lib and .dll file to work. But when I add them (or any other OCCT related .lib and .dll) to Unreal Engine (delayed load or not), editor trigger module can't load error. I have lots of third party library integration exprience such as open62541, libmodbus, realsense and pdfium.

Btw. I tried to build OCCT by myself with C++ 20 standart (because current standart of UE5.4.3 is this), it gives TCL not found error on cmake. So, I use prebuilt windows binaries.

Do you have any suggestion about it ?

Dmitrii Pasukhin's picture

Hello, C++ standard do no impact on CMake lib search. Please check that you update CMake parameter for build OCCT correct. C++ Standrd can be updated with -DBUILD_CPP_STANDARD=C++20

As for a loading issue, I can't help without problem messages. You always can check the dllload system calls by https://learn.microsoft.com/en-us/sysinternals/downloads/procmon if information provided by default is not enough.

If you build with JeMalloc and any other 3rd-parties, please check that all of them located in the same folder where OCC dll is located. Probably you will need to copy all of them manually or check CMake variables (install section).

Additionally, you provide a complex list of header with a lot of cascade dependencies. Even just TKMesh needs some other TK to work. There should be no any critical changes from any other soft. From my side at least I do not found any issue with OCCT project as a plug-in for popular soft (C++ or C# plug-ins).

Best regards, Dmitrii.

Eray Ozer's picture

I am familiar with additional dependency concept. I didn't use JeMalloc or any other library for my custom build and also pre-built binaries didn't mention that, too. Generally if there is additional lib necessity, Unreal build tool and Visual Studio give us LINK error. Not engine crash. Anyway, if you say I have to also integrate jemalloc, I can do that.

Btw. Unreal Engine doesn't work with folders. We just need to give correct path in plugin.build.cs

Dmitrii Pasukhin's picture

Real-time linking never can be detected by build tool. It is only your final application can say that lib can't be loaded in real-time linking. And depends only on PATH variable and DLL located in the same folder.

No, you don't need jemalloc by default. But pre-build OCCT package have a lot of dependencies.

Please check USE_* variables during your OCCT CMake configuration. Probably there is some dependencies are used.

Best regards, Dmitrii.