I am using Activiz and attempt to replace the underlying vtk binaries with ones I have compiled myself (using VS 2022), since I did some minor code changes.
However when I start my project, I get a P/Invoke error that the a required function was not found. I compared the exports of my vtk binaries with the ones delivered with Activiz, but the exports including name mangling look the same.
Any ideas to get this working, or any obvious compiler flags I may have missed?
Which version of Activiz are you using? The VTK version should probably be the same as the one used to compile Activiz to make sure things work.
It is vtk version 9.1 along with Activiz 9.1, I tried compiling the 9.1 vtk version and 9.1 rc4 version, neither of which work with Activiz.
Is the exact version number 9.1.2022.222 for Activiz? In this case using VTK on commit f8d16723b31c4e4ae457ce157c3cb05c783dcad7 might work. Activiz is not built on a specific VTK tag which could explain why using 9.1 tags did not work.
Hello,
Using different libraries without rebuilding the client binary is often a bad idea. Not all of VTK symbols are mangled. There are parts in C, which are not mangled (extern C{...}
). My advice: try to rebuild Activiz linking against the new VTK libraries you have.
best,
PC
Thanks, I wasn’t aware that we would be able to do this, I will try it
It seems that Activiz is not open sourced so you can’t build it yourself I fear. So, I believe you have to ask the project maintainers (https://www.kitware.eu/contact/) which is the most recent tag of VTK that is fully compatible with your current version (in full detail) of Activiz.
Not only the specific source code tag, but you will also need the exact VTK build configuration they use to build Activiz. Differences in configuration often also result in incompatibility. If they say they customize or patch VTK code before building then you’re likely out of luck.
I confirm Activiz is not open source anymore. If that helps, below you will find the different configurations that were used.
In general we use the VTK code without additional patches.
- ActiViz 9.1.2022.222: VTK@f8d16723 with VS2017 generator on Windows
- ActiViz 9.3.2024.515: VTK@5fd6015c with VS2022 generator on Windows
- ActiViz 9.4.2024.1104: VTK@713df75f with VS2022 generator on Windows
The following VTK options are generally used for each version:
VTK_SMP_IMPLEMENTATION_TYPE:STRING=STDThread
CMAKE_BUILD_TYPE:STRING="Release"
CMAKE_CXX_FLAGS:STRING="/DWIN32 /D_WINDOWS /W3 /GR /EHsc /MP4"