VTK9 and ITK5 conflicts

When vtkMultithreader.h and itkMultiThreader.h are both used then

VTK/Common/Core/vtkMultiThreader.h line 95
#define ThreadInfoStruct vtkMultiThreader::ThreadInfo

causes conflicts with ITK (master as of 20180326)

Modules/Core/Common/include/itkMultiThreader.h: struct ThreadInfoStruct: MultiThreaderBase::ThreadInfoStruct
Modules/Core/Common/include/itkMultiThreaderBase.h: struct ThreadInfoStruct

The #define in the VTK file changes the name of the struct in the ITK file.

I think this is a bug in VTK v9.

1 Like

I think defines in each toolkit should be namespaced.

On the ITK side, the struct is already in the itk:: namespace.

On the VTK side, it should probably be:

#define vtkThreadInfoStruct vtkMultiThreader::ThreadInfo

JC, I think this is a hack for backwards compatibility. Slicer uses “ThreadInfoStruct” for vtk in some places.

My guess is that it will have different behavior for different versions of VTK.

Hans

Then changes are needed in VTK. Who should write a patch and submit a PR?

See: https://gitlab.kitware.com/vtk/vtk/merge_requests/4136

4 Likes

To follow up, corresponding fix what just got merged in upstream VTK.

Update of Slicer will follow up.

1 Like