# Slicer nightly does not build with Qt4/VTK7

**URL:** <https://discourse.slicer.org/t/slicer-nightly-does-not-build-with-qt4-vtk7/2631>\
**Category:** Support\
**Created:** [April 19, 2018, 9:57am UTC](https://discourse.slicer.org/t/slicer-nightly-does-not-build-with-qt4-vtk7/2631 "2018-04-19T09:57:58Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![Eloise](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/eloise/32/3948_2.png) [@Eloise](https://discourse.slicer.org/u/Eloise)\
**Post date:** [April 19, 2018, 9:57am UTC](https://discourse.slicer.org/t/slicer-nightly-does-not-build-with-qt4-vtk7/2631/1 "2018-04-19T09:57:58Z")

</div>

Hello,

I am trying to build Slicer (developper mode) on Mac osX running Sierra (version 10.12). I’ve downloaded the latest sources (April 17 2018) with git and I am currently getting this error message below when building with cmake (3.11.1). I am using CMAKE\_BUILD\_TYPE set to Release, CMAKE\_OSX\_DEPLOYMENT\_TARGET set to 10.12 (tried 10.9 but got the same error), and Xcode version 8.3.3.

The build fails on “VTKITKVectorReader” target with the following error :

‘vtkDiscreteFlyingEdges3D.h’ file not found

Is there any compatibility problem with the latest sources (in particular VTK, I use VTK7) and Sierra? Did anyone have successfully built the latest Slicer on Sierra?

Thanks.

---

<div class="post-metadata">

**Author:** ![ihnorton](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/ihnorton/32/9_2.png) [@ihnorton](https://discourse.slicer.org/u/ihnorton)\
**Post date:** [April 19, 2018, 1:12pm UTC](https://discourse.slicer.org/t/slicer-nightly-does-not-build-with-qt4-vtk7/2631/2 "2018-04-19T13:12:52Z")

</div>

Which qt version, and from where did you download or build?

---

<div class="post-metadata">

**Author:** ![Eloise](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/eloise/32/3948_2.png) [@Eloise](https://discourse.slicer.org/u/Eloise)\
**Post date:** [April 19, 2018, 1:48pm UTC](https://discourse.slicer.org/t/slicer-nightly-does-not-build-with-qt4-vtk7/2631/3 "2018-04-19T13:48:37Z")

</div>

Hi,

I have qt 4.7.4 and I download the sources from git repository (command : git clone [https://github.com/Slicer/Slicer.git](https://github.com/Slicer/Slicer.git), version 4.9)  
Actually, the problem mentioned in my previous post is solved, I guess it came from git/https protocol I used. But I have another building issue, I get different errors referring to "use of undeclared identifier " from DCMTK, it seems that the building of this version of Slicer requires C++11 ?

Thanks for your help

---

<div class="post-metadata">

**Author:** ![ihnorton](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/ihnorton/32/9_2.png) [@ihnorton](https://discourse.slicer.org/u/ihnorton)\
**Post date:** [April 19, 2018, 2:04pm UTC](https://discourse.slicer.org/t/slicer-nightly-does-not-build-with-qt4-vtk7/2631/4 "2018-04-19T14:04:27Z")

</div>

I’ve seen some discussion of the `undeclared identifier` problem, but I thought that had been fixed with a DCMTK update.

If you don’t have a reason to use Qt4, I would suggest starting with Qt5, because that is the most maintained/tested now, and will build everything with C++11. I am successfully building on macOS 10.12 against Qt 5.10.1 from [http://download.qt.io/official\_releases/qt/5.10/5.10.1/](http://download.qt.io/official_releases/qt/5.10/5.10.1/)

If you do need Qt4 then somebody can try to debug, but otherwise please try Qt5 using [these instructions](https://www.slicer.org/wiki/Documentation/Labs/Qt5-and-VTK8#Status). eg on my computer:

```auto
cd /opt/bld/r/r5nj
ccmake -DQt5_DIR=/opt/sw/Qt_ol/5.10.1/clang_64/lib/cmake/Qt5 ~/git/s5

```

note that the base path for your build should be a relatively short path, in order to avoid errors described [here](https://discourse.slicer.org/t/macos-sierra-10-12-6-dynamic-linker-errors/2339). I would suggest staying under about 20 characters or so.

---

<div class="post-metadata">

**Author:** ![Eloise](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/eloise/32/3948_2.png) [@Eloise](https://discourse.slicer.org/u/Eloise)\
**Post date:** [April 20, 2018, 2:15pm UTC](https://discourse.slicer.org/t/slicer-nightly-does-not-build-with-qt4-vtk7/2631/5 "2018-04-20T14:15:14Z")

</div>

Thanks for your reply.  
I followed your suggestions, since I don’t specifically need Qt4, I tried building Slicer using Qt5, I got a new error during the SVN checkout of EMSegment :

svn: E000060: Operation timed out

I have svn version 1.9.4, I can’t find where the error comes from ?

---

<div class="post-metadata">

**Author:** ![ihnorton](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/ihnorton/32/9_2.png) [@ihnorton](https://discourse.slicer.org/u/ihnorton)\
**Post date:** [April 20, 2018, 4:29pm UTC](https://discourse.slicer.org/t/slicer-nightly-does-not-build-with-qt4-vtk7/2631/6 "2018-04-20T16:29:32Z")

</div>

I saw that issue yesterday, and turned off building EMSegment off with `-DSlicer_BUILD_EMSegment:BOOL=OFF` (or setting it in the CMake GUI, under Advanced options). I normally do turn it off because I don’t need it, but forgot for that build.

There may be an intermittent network issue with the SVN server, however I just now tried it again (`svn co http://svn.slicer.org/Slicer3/branches/Slicer4-EMSegment`) and it worked.

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [April 21, 2018, 7:17pm UTC](https://discourse.slicer.org/t/slicer-nightly-does-not-build-with-qt4-vtk7/2631/7 "2018-04-21T19:17:03Z")

</div>

> [@Eloise](#):
>
> ‘vtkDiscreteFlyingEdges3D.h’ file not found

I’ve recently made some changes in the Slicer trunk that require VTK9. if you build with Qt4/VTK7?

@jcfr Do you still need VTK7/Qt4 compatibility in the trunk?

---

<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:** [April 21, 2018, 7:29pm UTC](https://discourse.slicer.org/t/slicer-nightly-does-not-build-with-qt4-vtk7/2631/8 "2018-04-21T19:29:38Z")

</div>

Later this week, I will check with our team and report back.

Note that I will have limited access to internet until Wed evening (pacific time)

---

<div class="post-metadata">

**Author:** ![Eloise](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/eloise/32/3948_2.png) [@Eloise](https://discourse.slicer.org/u/Eloise)\
**Post date:** [April 23, 2018, 9:50am UTC](https://discourse.slicer.org/t/slicer-nightly-does-not-build-with-qt4-vtk7/2631/9 "2018-04-23T09:50:40Z")

</div>

Hi,

I turned off building of EMSegment as suggested by Isaiah and the compilation worked finally !!  
Thank you very much!

---

<div class="post-metadata">

**Author:** ![wpgao](https://avatars.discourse-cdn.com/v4/letter/w/8e8cbc/32.png) [@wpgao](https://discourse.slicer.org/u/wpgao)\
**Post date:** [April 26, 2018, 6:42am UTC](https://discourse.slicer.org/t/slicer-nightly-does-not-build-with-qt4-vtk7/2631/10 "2018-04-26T06:42:07Z")

</div>

Hi guys,

Recently, I builded Slicer on Window 10 with qt 4.8.7 and got following error.  
Slicer\Libs\vtkSegmentationCore\vtkBinaryLabelmapToClosedSurfaceConversionRule.cxx(28): fatal error C1083: Cannot open include file: ‘vtkDiscreteFlyingEdges3D.h’: No such file or directory [F:\S4R\Slicer-build\Libs\vtkSegmentationCore\vtkSegmentationCore.vcxproj] It seems that it is related to vtk version. Can anybody give any advice. Thanks!

Operating system: Win 10  
Slicer version: 4.9  
Expected behavior:  
Actual behavior:

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [April 26, 2018, 12:42pm UTC](https://discourse.slicer.org/t/slicer-nightly-does-not-build-with-qt4-vtk7/2631/11 "2018-04-26T12:42:37Z")

</div>

@wpgao I’ve moved your post here, as it is a duplicate of this report.

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [April 26, 2018, 7:31pm UTC](https://discourse.slicer.org/t/slicer-nightly-does-not-build-with-qt4-vtk7/2631/12 "2018-04-26T19:31:22Z")

</div>

I have [updated code in the trunk](https://github.com/Slicer/Slicer/commit/ea976db9beaa7ca1774b97f6d77769237fb0775a) to allow building with both Qt5/VTK9 and Qt4/VTK7. Note that VTK7/Qt4 support will be dropped latest after the next stable build (Slicer-4.10) will be released, probably in a couple of weeks.

---

<div class="post-metadata">

**Author:** ![wpgao](https://avatars.discourse-cdn.com/v4/letter/w/8e8cbc/32.png) [@wpgao](https://discourse.slicer.org/u/wpgao)\
**Post date:** [April 27, 2018, 1:37pm UTC](https://discourse.slicer.org/t/slicer-nightly-does-not-build-with-qt4-vtk7/2631/13 "2018-04-27T13:37:15Z")

</div>

Hi Andras,

Thanks for you information. I have a question about Qt5: whether it should be build with openssl? Since 3D slicer is updated frequently, the module developed using c++ under the older version can not work in the new version. Is there any way to let the module work in the new version easily? I’m not good at this. Forgive me , if the question is too simple!

Thanks again!

Best,

Wenpeng

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [April 27, 2018, 5:33pm UTC](https://discourse.slicer.org/t/slicer-nightly-does-not-build-with-qt4-vtk7/2631/14 "2018-04-27T17:33:50Z")

</div>

You should be able to still build Slicer with VTK7/Qt4 (I’ve made breaking changes conditional, based on the VTK version), so in the short term you can still build using Qt4.

Qt5 build: SSL is not required, but if you don’t use a Qt that has been built with OpenSSL then downloads through https protocol will fail (sample data, extension manager, etc. uses https for most downloads).

---

<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:** [April 28, 2018, 6:37am UTC](https://discourse.slicer.org/t/slicer-nightly-does-not-build-with-qt4-vtk7/2631/15 "2018-04-28T06:37:06Z")

</div>

> [@lassoan](#):
>
> Note that VTK7/Qt4 support will be dropped latest after the next stable build (Slicer-4.10) will be released

👍

> [@lassoan](#):
>
> You should be able to still build Slicer with VTK7/Qt4 (I’ve made breaking changes conditional, based on the VTK version), so in the short term you can still build using Qt4.

Thanks for implementing the fixes.
