# Build Error PythonQt Visual Studio 2015 Qt 5.9.2

**URL:** <https://discourse.slicer.org/t/build-error-pythonqt-visual-studio-2015-qt-5-9-2/1411>\
**Category:** Development\
**Tags:** qt\
**Created:** [November 8, 2017, 9:40pm UTC](https://discourse.slicer.org/t/build-error-pythonqt-visual-studio-2015-qt-5-9-2/1411 "2017-11-08T21:40:55Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![danielbr](https://avatars.discourse-cdn.com/v4/letter/d/c2a13f/32.png) [@danielbr](https://discourse.slicer.org/u/danielbr)\
**Post date:** [November 8, 2017, 9:40pm UTC](https://discourse.slicer.org/t/build-error-pythonqt-visual-studio-2015-qt-5-9-2/1411/1 "2017-11-08T21:40:55Z")

</div>

Trying to build slicer 4.8.0 with Qt 5.9.2. I get really close to a full complete build, but PythonQt in CTK fails everytime with a laundry list of errors. I am using Visual Studio 2015 I turned off Slicer\_USE\_PYTHONQT\_WITH\_OPENSSL. I also tried turning off Slicer\_USE\_PYTHONQT\_WITH\_TCL and had the exact same result. I have attached my build output, but the problem seems to be with QOpenGLTimeMonitor. Anyone have any suggestions?

For reference I built Qt with the following configure (configure -prefix D:/Qt/5926415R -release -opensource -confirm-license -platform win32-msvc2015 -nomake examples -nomake tests -openssl -I D:/OpenSSL/OpenSSL-64VS15/include -L D:/OpenSSL/OpenSSL-64VS15)

Build output here:

[Build Output](https://pastebin.com/wQEREi25)

I should note that I also tried the latest commit of slicer 4.9.0 as of today and got the same error.

---

<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:** [November 8, 2017, 10:16pm UTC](https://discourse.slicer.org/t/build-error-pythonqt-visual-studio-2015-qt-5-9-2/1411/2 "2017-11-08T22:16:34Z")

</div>

Did you follow the instructions here?: [https://www.slicer.org/wiki/Documentation/Labs/Qt5-and-VTK8#Status](https://www.slicer.org/wiki/Documentation/Labs/Qt5-and-VTK8#Status)

I did that a few weeks ago, with no other changes, and successfully built against Qt 5.9.2 (VS2015 lib) installed with the Qt installer. 28 tests fail, but I think most of them are known issues.

---

<div class="post-metadata">

**Author:** ![danielbr](https://avatars.discourse-cdn.com/v4/letter/d/c2a13f/32.png) [@danielbr](https://discourse.slicer.org/u/danielbr)\
**Post date:** [November 8, 2017, 10:26pm UTC](https://discourse.slicer.org/t/build-error-pythonqt-visual-studio-2015-qt-5-9-2/1411/3 "2017-11-08T22:26:01Z")

</div>

Yep I changed the Slicer\_REQUIRED\_QT\_VERSION to 5.9.2 which made the QT5\_DIR come up and then I set that to my qtdirectory/lib/cmake/Qt5.

---

<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:** [November 8, 2017, 10:46pm UTC](https://discourse.slicer.org/t/build-error-pythonqt-visual-studio-2015-qt-5-9-2/1411/4 "2017-11-08T22:46:46Z")

</div>

From an empty directory, if you configure using:

```auto
cmake -DQt5_DIR:PATH=... 

```

There is no need to manually set `Slicer_REQUIRED_QT_VERSION`.

If you are using cmake-gui or ccmake, just make sure you are **NOT** configuring a first time and then setting the `Qt5_DIR` variable.

You need to set the `Qt5_DIR` variable the first time you configure. That way all default values are properly initialized.

---

<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:** [November 8, 2017, 10:49pm UTC](https://discourse.slicer.org/t/build-error-pythonqt-visual-studio-2015-qt-5-9-2/1411/5 "2017-11-08T22:49:18Z")

</div>

> [@danielbr](#):
>
> I built Qt with the following configure

Waiting we test and finalize updates associated with building Qt from source, there is no problem downloading existing binaries. It just mean that if you do a debug build, you will not be able to use the QtDesigner or QtCreator and make use of the custom designer/QtCreator plugins offered by CTK and Slicer to design UI

---

<div class="post-metadata">

**Author:** ![danielbr](https://avatars.discourse-cdn.com/v4/letter/d/c2a13f/32.png) [@danielbr](https://discourse.slicer.org/u/danielbr)\
**Post date:** [November 8, 2017, 11:04pm UTC](https://discourse.slicer.org/t/build-error-pythonqt-visual-studio-2015-qt-5-9-2/1411/6 "2017-11-08T23:04:11Z")

</div>

ok I will try this in a new directory. I will let it build overnight and see if that solves the issue. I will report back. Thanks!

---

<div class="post-metadata">

**Author:** ![danielbr](https://avatars.discourse-cdn.com/v4/letter/d/c2a13f/32.png) [@danielbr](https://discourse.slicer.org/u/danielbr)\
**Post date:** [November 9, 2017, 1:32pm UTC](https://discourse.slicer.org/t/build-error-pythonqt-visual-studio-2015-qt-5-9-2/1411/7 "2017-11-09T13:32:04Z")

</div>

Still not building pythonQt. So I am using the cmake gui. I created a new directory opened the cmake gui and set Qt5\_DIR and QT\_QMAKE\_EXECUTABLE before configuring. Configured generated and opened the project. Started the build. Again most everything built but it is still failing to build pythonQt. The first error occurs at recognizing QOpenGLTimeMonitor… Any other suggestions to get this working?

---

<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:** [November 9, 2017, 2:13pm UTC](https://discourse.slicer.org/t/build-error-pythonqt-visual-studio-2015-qt-5-9-2/1411/8 "2017-11-09T14:13:05Z")

</div>

I usually create a .bat file that configures CMake using -D parameters. It is less work and more reproducible than setting CMake variables manually each time I need a clean rebuild.

---

<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:** [November 9, 2017, 2:17pm UTC](https://discourse.slicer.org/t/build-error-pythonqt-visual-studio-2015-qt-5-9-2/1411/9 "2017-11-09T14:17:12Z")

</div>

FWIW, here’s the selections I used with the Qt online installer. I would also suggest to build from top-of-trunk because there are continuous improvements, and targeting 4.8 because it’s a “release” is meaningless for a non-default configuration.

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/8/9/89ecb534331a6837c039da82f783fd35473e8562.jpeg)

---

<div class="post-metadata">

**Author:** ![danielbr](https://avatars.discourse-cdn.com/v4/letter/d/c2a13f/32.png) [@danielbr](https://discourse.slicer.org/u/danielbr)\
**Post date:** [November 9, 2017, 9:44pm UTC](https://discourse.slicer.org/t/build-error-pythonqt-visual-studio-2015-qt-5-9-2/1411/10 "2017-11-09T21:44:06Z")

</div>

Ok I installed Qt using the Qt installer with the options you suggested. Everything built this time except for python. Python says “unresolved external symbol \_Py\_silent\_invalid\_parameter\_handler referenced in function new\_threadstate” in the libpython-shared project. I am used the top of the trunk for this build. Any ideas to solve this last problem?

---

<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:** [November 9, 2017, 11:14pm UTC](https://discourse.slicer.org/t/build-error-pythonqt-visual-studio-2015-qt-5-9-2/1411/11 "2017-11-09T23:14:17Z")

</div>

Remove the `superbuild/[Python-2.7.13, python-build, python-prefix]` directories and build again. Should be fixed by the following, but I don’t know if the commit was bumped in slicer yet:

[https://github.com/python-cmake-buildsystem/python-cmake-buildsystem/pull/195](https://github.com/python-cmake-buildsystem/python-cmake-buildsystem/pull/195)

---

<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:** [November 9, 2017, 11:33pm UTC](https://discourse.slicer.org/t/build-error-pythonqt-visual-studio-2015-qt-5-9-2/1411/12 "2017-11-09T23:33:21Z")

</div>

> [@danielbr](#):
>
> I created a new directory opened the cmake gui and set Qt5\_DIR and QT\_QMAKE\_EXECUTABLE before configuring

Only `Qt5_DIR` should be set. `QT_QMAKE_EXECUTABLE` was specific to Qt4 configuration.

---

<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:** [November 9, 2017, 11:34pm UTC](https://discourse.slicer.org/t/build-error-pythonqt-visual-studio-2015-qt-5-9-2/1411/13 "2017-11-09T23:34:13Z")

</div>

> [@ihnorton](#):
>
> Should be fixed by the following, but I don’t know if the commit was bumped in slicer

~~Not yet. It will be done shortly.~~ **Done** - See [r26559](http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&revision=26559)

---

<div class="post-metadata">

**Author:** ![danielbr](https://avatars.discourse-cdn.com/v4/letter/d/c2a13f/32.png) [@danielbr](https://discourse.slicer.org/u/danielbr)\
**Post date:** [November 9, 2017, 11:56pm UTC](https://discourse.slicer.org/t/build-error-pythonqt-visual-studio-2015-qt-5-9-2/1411/14 "2017-11-09T23:56:23Z")

</div>

Gonna try not setting QT\_QMAKE\_EXECUTABLE and rebuild fresh. Will let it run overnight. Will report back if I have success. Thanks for all of the help. One of these times it is going to build!

---

<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:** [November 10, 2017, 12:04am UTC](https://discourse.slicer.org/t/build-error-pythonqt-visual-studio-2015-qt-5-9-2/1411/15 "2017-11-10T00:04:12Z")

</div>

You are welcome.

It should really be a seamless experience. We will try to improve things.

@lassoan @ihnorton For some time I have been thinking about creating a “SlicerDevelopmentEnvironment” project on GitHub where we would keep:

This would ne lightweight and allow to store:

- batch/shell script to build Slicer
- and other misc scripts

Or we could commit batch script directly to Slicer repo.

Here is what was done for ITK: [https://github.com/InsightSoftwareConsortium/ITKDevelopmentEnvironment](https://github.com/InsightSoftwareConsortium/ITKDevelopmentEnvironment)

---

<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:** [November 10, 2017, 12:45pm UTC](https://discourse.slicer.org/t/build-error-pythonqt-visual-studio-2015-qt-5-9-2/1411/16 "2017-11-10T12:45:41Z")

</div>

A post was split to a new topic: [Windows build scripts and simplification](https://discourse.slicer.org/t/windows-build-scripts-and-simplification/1431)

---

<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:** [November 10, 2017, 12:46pm UTC](https://discourse.slicer.org/t/build-error-pythonqt-visual-studio-2015-qt-5-9-2/1411/17 "2017-11-10T12:46:19Z")

</div>

(I moved my response to a new topic because it is not directly related to the original post)

---

<div class="post-metadata">

**Author:** ![danielbr](https://avatars.discourse-cdn.com/v4/letter/d/c2a13f/32.png) [@danielbr](https://discourse.slicer.org/u/danielbr)\
**Post date:** [November 10, 2017, 3:14pm UTC](https://discourse.slicer.org/t/build-error-pythonqt-visual-studio-2015-qt-5-9-2/1411/18 "2017-11-10T15:14:22Z")

</div>

Ok it worked! I was able to build it finally. Now I have one last issue that I need to solve. When I open slicer it complains that the OpenGL Core Profile was requested but it is not supported on my current platform… I assumed this must me a graphics card driver issue. I have the NVIDIA NVS 315 which is supposed to support OpenGL. I tried updating the drivers to the latest, but slicer still complains and says it is not supported. Any ideas of how to remedy this?

---

<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:** [November 10, 2017, 3:46pm UTC](https://discourse.slicer.org/t/build-error-pythonqt-visual-studio-2015-qt-5-9-2/1411/19 "2017-11-10T15:46:19Z")

</div>

> [@danielbr](#):
>
> OpenGL Core Profile was requested but it is not supported on my current platform

This comes from QWebEngine, and I believe it is a known issue with the initialization. GL/VTK stuff in Slicer proper should work fine.
