how to read STEP file in vtk wasm

Hi everyone,

I’m currently trying to read STEP files in VTK WASM. Based on some previous posts, I recompiled the vtk-master version, set VTK_MODULE_ENABLE_VTK_IOOCCT to YES, and compiled a 32-bit version of OpenCASCADE (my WASM is also 32-bit). I pointed the OpenCASCADE_DIR to the folder with the compiled files.

During the VTK-master compilation, I encountered the following warning:

CMake Warning (dev) at D:/OpenCASCADE/OCCT-7_9_2_build/OpenCASCADEFoundationClassesTargets.cmake:57 (add_library):
  ADD_LIBRARY called with SHARED option but the target platform does not
  support dynamic linking.  Building a STATIC library instead.  This may lead
  to problems.
Call Stack (most recent call first):
  D:/OpenCASCADE/OCCT-7_9_2_build/OpenCASCADEConfig.cmake:100 (include)
  CMake/vtkModule.cmake:5394 (find_package)
  IO/OCCT/CMakeLists.txt:1 (vtk_module_find_package)
This warning is for project developers.  Use -Wno-dev to suppress it.

However, the compilation was successful in the end. When I used the compiled VTK to compile my C++ code, I encountered the following error:

wasm-ld: error: unknown file type: D:/OpenCASCADE/win32/vc14/bin/TKDESTEP.dll

I suspect this might be related to dynamic linking, so I tried recompiling VTK with BUILD_SHARED_LIBS enabled, but there was no change—the two errors still occur.

When I do not use IOOCCT, I can compile other C++ files without any issues. This process was performed on a Windows 10 system.

Could anyone point out what might be missing in my configuration or steps? Any guidance would be much appreciated!

Why don’t you want to build with STATIC linking ?