# VTK9 and ITK5 conflicts

**URL:** https://discourse.itk.org/t/vtk9-and-itk5-conflicts/802
**Category:** Engineering
**Tags:** build
**Created:** [March 27, 2018, 2:08am UTC](https://discourse.itk.org/t/vtk9-and-itk5-conflicts/802 "2018-03-27T02:08:25Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![hjmjohnson](https://discourse.itk.org/user_avatar/discourse.itk.org/hjmjohnson/32/23_2.png) [@hjmjohnson](https://discourse.itk.org/u/hjmjohnson)
#### Post date: [March 27, 2018, 2:08am UTC](https://discourse.itk.org/t/vtk9-and-itk5-conflicts/802/1 "2018-03-27T02:08:26Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![jcfr](https://discourse.itk.org/user_avatar/discourse.itk.org/jcfr/32/2526_2.png) [@jcfr](https://discourse.itk.org/u/jcfr)
#### Post date: [March 27, 2018, 2:22am UTC](https://discourse.itk.org/t/vtk9-and-itk5-conflicts/802/2 "2018-03-27T02:22:14Z")

</div>

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:

```auto
#define vtkThreadInfoStruct vtkMultiThreader::ThreadInfo

```

---

<div class="post-metadata">

### Author: ![hjmjohnson](https://discourse.itk.org/user_avatar/discourse.itk.org/hjmjohnson/32/23_2.png) [@hjmjohnson](https://discourse.itk.org/u/hjmjohnson)
#### Post date: [March 27, 2018, 2:23am UTC](https://discourse.itk.org/t/vtk9-and-itk5-conflicts/802/3 "2018-03-27T02:23:37Z")

</div>

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

---

<div class="post-metadata">

### Author: ![dzenanz](https://discourse.itk.org/user_avatar/discourse.itk.org/dzenanz/32/1093_2.png) [@dzenanz](https://discourse.itk.org/u/dzenanz)
#### Post date: [March 27, 2018, 1:30pm UTC](https://discourse.itk.org/t/vtk9-and-itk5-conflicts/802/4 "2018-03-27T13:30:22Z")

</div>

Then changes are needed in VTK. Who should write a patch and submit a [PR](https://gitlab.kitware.com/groups/vtk/-/merge_requests)?

---

<div class="post-metadata">

### Author: ![hjmjohnson](https://discourse.itk.org/user_avatar/discourse.itk.org/hjmjohnson/32/23_2.png) [@hjmjohnson](https://discourse.itk.org/u/hjmjohnson)
#### Post date: [March 27, 2018, 4:45pm UTC](https://discourse.itk.org/t/vtk9-and-itk5-conflicts/802/5 "2018-03-27T16:45:33Z")

</div>

See: [https://gitlab.kitware.com/vtk/vtk/merge\_requests/4136](https://gitlab.kitware.com/vtk/vtk/merge_requests/4136)

---

<div class="post-metadata">

### Author: ![jcfr](https://discourse.itk.org/user_avatar/discourse.itk.org/jcfr/32/2526_2.png) [@jcfr](https://discourse.itk.org/u/jcfr)
#### Post date: [March 27, 2018, 8:02pm UTC](https://discourse.itk.org/t/vtk9-and-itk5-conflicts/802/6 "2018-03-27T20:02:52Z")

</div>

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

Update of Slicer will follow up.
