# Master with Qt5 build fails

**URL:** <https://discourse.slicer.org/t/master-with-qt5-build-fails/1849>\
**Category:** Development\
**Tags:** qt\
**Created:** [January 15, 2018, 9:11pm UTC](https://discourse.slicer.org/t/master-with-qt5-build-fails/1849 "2018-01-15T21:11:15Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![adamrankin](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/adamrankin/32/155_2.png) [@adamrankin](https://discourse.slicer.org/u/adamrankin)\
**Post date:** [January 15, 2018, 9:11pm UTC](https://discourse.slicer.org/t/master-with-qt5-build-fails/1849/1 "2018-01-15T21:11:15Z")

</div>

Cloned Slicer master (b748b88cefa57bc126f3a5c64a4fb59c28e4bb9b) and tried to build with Qt 5.9.1.

Received many generation errors similar to:

```
  CMake Error at Libs/vtkAddon/CMakeLists.txt:94 (add_library):
    Cannot find source file:

      C:/d/Slcr/S4D/Slicer-build/Libs/vtkAddon/vtkAddonHierarchy.stamp.txt

    Tried extensions .c .C .c++ .cc .cpp .cxx .m .M .mm .h .hh .h++ .hm .hpp
    .hxx .in .txx

```

Has anyone else experienced this?

Edit: not suprising, but build errors follow on the form:

`CUSTOMBUILD : CMake error : CMake can not determine linker language for target: vtkAddon [C:\d\Slcr\S4D\Slicer.vcxproj]`

---

<div class="post-metadata">

**Author:** ![jcfr](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jcfr/32/17825_2.png) [@jcfr](https://discourse.slicer.org/u/jcfr)\
**Post date:** [January 15, 2018, 10:27pm UTC](https://discourse.slicer.org/t/master-with-qt5-build-fails/1849/2 "2018-01-15T22:27:36Z")

</div>

Most likely related to the VTKv9 update.

I submitted issue [17217](https://gitlab.kitware.com/vtk/vtk/issues/17217) to upstream VTK project and proposed a fix in [MR vtk/vtk#3794](https://gitlab.kitware.com/vtk/vtk/merge_requests/3794) (already added to Slicer fork of VTK).

This addressed issues I experienced on Linux.

Look like there are still some issues.

Here are some related references that will be helpful to debug:

> <https://github.com/Slicer/Slicer/blob/b748b88cefa57bc126f3a5c64a4fb59c28e4bb9b/Libs/vtkAddon/CMakeLists.txt#L146-L151>

> <https://github.com/Slicer/Slicer/blob/b748b88cefa57bc126f3a5c64a4fb59c28e4bb9b/CMake/vtkMacroKitPythonWrap.cmake#L121-L138>

> <https://github.com/Slicer/VTK/blob/slicer-v9.0.0-2018-01-11-590b341/CMake/vtkWrapHierarchy.cmake>

---

<div class="post-metadata">

**Author:** ![jcfr](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jcfr/32/17825_2.png) [@jcfr](https://discourse.slicer.org/u/jcfr)\
**Post date:** [January 15, 2018, 10:32pm UTC](https://discourse.slicer.org/t/master-with-qt5-build-fails/1849/3 "2018-01-15T22:32:16Z")

</div>

It turns out that the hierarchy stamp file has been removed in latest VTK:

> <https://github.com/Slicer/VTK/commit/a8ada6f05b950d8df50e2f6c7427591064d10f17#diff-5ce2dfc7465c1fe39c43979d84de3629>
>
> Instead, just use the hierarchy file as an output.

This means the following Slicer file would have to be updated accordingly:

[https://github.com/Slicer/Slicer/blob/b748b88cefa57bc126f3a5c64a4fb59c28e4bb9b/CMake/vtkMacroKitPythonWrap.cmake#L149-L154](https://github.com/Slicer/Slicer/blob/b748b88cefa57bc126f3a5c64a4fb59c28e4bb9b/CMake/vtkMacroKitPythonWrap.cmake#L149-L154)

---

<div class="post-metadata">

**Author:** ![jcfr](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jcfr/32/17825_2.png) [@jcfr](https://discourse.slicer.org/u/jcfr)\
**Post date:** [January 16, 2018, 12:47pm UTC](https://discourse.slicer.org/t/master-with-qt5-build-fails/1849/4 "2018-01-16T12:47:06Z")

</div>

Thanks for the patch @adamrankin

For future reference:

> <https://github.com/Slicer/Slicer/issues/866>
>
> \_This issue was created automatically from an original \[Mantis Issue\](https://ma…ntisarchive.slicer.org/view.php?id=866). Further discussion may take place here.\_

It has been integrated in [r26834](http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&revision=26834)
