Hi –
I have a C++ project that doesn’t use cmake, so vtk modules are loaded by explicitly listing the libraries in the linker arguments and using VTK_MODULE_INIT calls in the code. What is the best way to figure out which libraries to link and which modules to use with VTK_MODULE_INIT?
I tried using
WhatModulesVTK.py <vtk source> <my source>
It listed a bunch of modules in the minimal set, so I included them all in VTK_MODULE_INIT calls. At run time I got messages like this:
dyld: Symbol not found: __Z39vtkFiltersExtraction_AutoInit_Constructv
Referenced from: /Users/langer/stow/oof3d-development-debug3d-cocoa-2.7/lib/liboof3dcommon.dylib
Expected in: flat namespace
despite linking with -lvtkFiltersExtraction-8.2. In fact,
% nm -gUA libvtk*.dylib | grep FiltersExtraction_AutoInit_Construct
doesn’t find anything.
How can I find out what modules and libraries need to be included for a given VTK feature? Am I using VTK_INIT_MODULE or WhatModulesVTK.py incorrectly? Or, if FiltersExtraction_AutoInit_Construct is undefined, does it mean that I’ve built VTK incorrectly?
(FiltersExtraction is just the first of the modules listed by WhatModulesVTK.py that causes a problem – if I omit its VTK_MODULE_INIT the program actually compiles and runs. But I thought I should be able to include all of the modules that WhatModulesVTK.py lists. The actual reason that I tried using it is that I am trying to use vtkGL2PSExporter and can’t figure out how. The program will link but fails at run time with “Error: no override found for 'vtkGL2PSExporter”.)
I’m using VTK 8.2.0 on macOS Mojave.
Thanks,
Steve