Compilation issue after migrating to VTK-8.2

I have a research code that uses VTK-5.2 for visualization. In my Makefile I link specific VTK libraries for compilation. After installing VTK-8.2, the program does not compile. How do I need to change the Makefile to make things work with VTK-8.2 . Thank you

That is a lot of major versions to upgrade all at once :slight_smile: There is no upgrade guide or person who can tell you exactly what to do, I’m afraid. It will take some time to work through, so you’ll need some patience.

If your project is simple, there probably isn’t too much to change. I suggest reporting errors one at a time in this topic as you come across them and folks may be able to chime in and tell you how to resolve specific errors.

Thanks Cory for the suggestion. The code I use is not that big. For version 5.10 I linked --lvtkIO -lvtkRendering -lvtkGraphics -lvtkzlib -lvtkFiltering -lvtkCommon. VTKGraphics and vtkzlib are not in 8.2. The following errors I get during the compilation:

Undefined symbols for architecture x86_64:
“vtkPolyData::New()”, referenced from:
vtkSmartPointer::New() in cccaFLWd.o

It looks like I need to add some libraries to the makefile but I do not know which ones

To figure this out, you can head over to the VTK doxygen documentation, search for the class that the linker is complaining about, click on it, scroll to the bottom of the class documentation page, and figure out the library needed.

For vtkPolyData, go to its documentation page and scroll to the bottom. The file is located in Common/DataModel/vtkPolyData.h. Append Common and DataModel together, prefix it with libvtk, and you’ll get the required library libvtkCommonDataModel.

Do this for all such linker errors and you should have the libraries you need.

You can also figure this out with a Python utility script FindNeededModules.py written by @amaclean which is located in the VTK source code in Utilities/Maintenance/. Documentation on how to use the script is in comments in the script.

Thanks for the suggestion!