I get this compile error with hash xxx: 55>c:\dev\slicer\libs\freesurfer\vtkFSLookupTable.h(84): error C2555: 'vtkFSLookupTable::MapValue': overriding virtual function return type differs and is not covariant from 'vtkLookupTable::MapValue' [C:\Dev\S3\Slicer-build\Libs\FreeSurfer\FreeSurfer.vcxproj]
The reason seems to be change of the MapValue method in VTK to return const char * (it was previously without const).
If we are trying to support two versions of VTK, we might need to wrap this definition in an #if VTK9 block or something similar. If not, just adding const will do.
This was introduced in 47e5662bf321acb87f15e83d7f3415faeb44f72f (ENH: Update VTK)
Commit ce5575e36aef609c125b8c3a577a9cccd9cdde30 by Sean McBride “Made vtkScalarsToColor::MapValue() return const” caused this. I think that change could simply be reverted, as it causes a divergence from mainline VTK. The reason for this change was not given in the commit message.
Or we could simply apply the same change on our fork of VTK7, that way after transitioning to VTK9 … the Slicer code base would work without any change.
If making return value const is the right thing to do, why not make a PR to mainstream VTK too? If it is not, we could apply this patch to VTK7 branch too.