I inherited some C++ code that uses VTK. I’m on macOS Sequoia 15.7.4.
I installed VTK via homebrew. I can see the install in /usr/local/cellar/vtk/9.5.2_3.
The makefile uses -lvtkIO -lvtkCommon -lvtkFiltering … (among many) as options to the compiler.
The compilation fails with message “ld: library ‘vtkIO’ not found“
I cannot see any libvtkIO in the install location. But I do see a whole lot of libvtkIOxxxxx.dylib files, where xxxxx corresponds to various files like libvtkIOChemistry-9.5.dylib, libvtkIOAMR-9.5.dylib, etc. I did make sure that the compiler has the correct path to the location:
Can somebody guide me as to how to solve this? I’m new to VTK, I didn’t write the code, and I don’t know much about compilers :(. Do I have to build VTK from scratch ?
Those vtkIO library names are ancient. The only supported way to update the code to a modern VTK is to:
use CMake for the project and find_package(VTK) (preferred)
update the code to use modern VTK library names (enabling kits in the VTK build will bundle multiple modules into larger libraries; disabling the versioned suffixes would also get you closer)
Note that APIs have changed significantly since that time, so I imagine there are C++ changes to do as well.
I can’t say directly off-hand, but I suspect an ancient CMake may be necessary too at this point. CMake 4.0 will definitely be grumpy about its minimum required version at least. Can you try a similarly vintaged CMake? 2.8.8 ma do, but 2.8.12 or 3.0.2 is where I’d start.