# Build Slicer on Windows 10 Failed

**URL:** https://discourse.slicer.org/t/build-slicer-on-windows-10-failed/2232
**Category:** Support
**Tags:** qt
**Created:** [March 2, 2018, 9:29pm UTC](https://discourse.slicer.org/t/build-slicer-on-windows-10-failed/2232 "2018-03-02T21:29:09Z")
**Posts on this page:** 20
**Page:** 2

<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: [June 23, 2018, 2:45pm UTC](https://discourse.slicer.org/t/build-slicer-on-windows-10-failed/2232/21 "2018-06-23T14:45:08Z")

</div>

> [@Saima](#):
>
> I will be developing with Slicer

What do you plan to develop? You have full access to all Slicer internals from Python and there are many customization options, so there are very few things that actually requires rebuilding of Slicer.

Build instructions are up-to-date for latest stable (Slicer-4.8) and we’ll provide build instructions for latest version (Slicer-4.9) within a few weeks (you can monitor status of this task [here](https://issues.slicer.org/view.php?id=4571)). Until then, you should be able to build based on hints provided by @jamesobutler above.

---

<div class="post-metadata">

### Author: ![Saima](https://avatars.discourse-cdn.com/v4/letter/s/9d8465/32.png) [@Saima](https://discourse.slicer.org/u/Saima)
#### Post date: [June 23, 2018, 4:27pm UTC](https://discourse.slicer.org/t/build-slicer-on-windows-10-failed/2232/22 "2018-06-23T16:27:33Z")

</div>

> [@lassoan](#):
>
> What do you plan to develop?

Dear Andras,  
I am working with Karol Miller at ISML laboratory. I am a PhD student and just started my Phd. Initial plan is to integrate meshless (nodes not meshes) solutions developed at ISML for generating patient specific computational grids from MRI images.

I have to figure out how to generate this computational grid on images. any idea from where I can start after building slicer?

Regards,  
Saima

---

<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: [June 23, 2018, 6:08pm UTC](https://discourse.slicer.org/t/build-slicer-on-windows-10-failed/2232/23 "2018-06-23T18:08:23Z")

</div>

Again, you don’t need to build Slicer to extend it.

We are collaborating with your group already (I think we even have some joint funded project), so the best would be to have a Skype call to have a quick discussion about this. Please [write me a private message](https://discourse.slicer.org/u/lassoan) or send an email to find a suitable time.

---

<div class="post-metadata">

### Author: ![brhoom](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/brhoom/32/1228_2.png) [@brhoom](https://discourse.slicer.org/u/brhoom)
#### Post date: [June 23, 2018, 8:30pm UTC](https://discourse.slicer.org/t/build-slicer-on-windows-10-failed/2232/24 "2018-06-23T20:30:55Z")

</div>

try uninstall python, restart, reconfigure using cmake. The best experience for me to build Slicer is using fresh installed windows then build Slicer requirements, after that build Slicer.

Also, I found building and using Slicer in Ubuntu is mush simpler and faster.

---

<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: [June 23, 2018, 11:14pm UTC](https://discourse.slicer.org/t/build-slicer-on-windows-10-failed/2232/25 "2018-06-23T23:14:51Z")

</div>

> [@brhoom](#):
>
> Also, I found building and using Slicer in Ubuntu is mush simpler and faster

It is always the easiest to build on the platform you are the most familiar with.

There is some truth in the points you described above, but there are simpler solutions to address these issues.

You can have Python versions installed, but you should never add Python path to global (system or user) environment variables. You may uninstall Python as a solution, but it is enough if you check that your global environment is not polluted.

There is no need for a “clean” Windows install, the only important requirement is that if you must install multiple Visual Studio versions, always install the older versions first.

---

<div class="post-metadata">

### Author: ![Saima](https://avatars.discourse-cdn.com/v4/letter/s/9d8465/32.png) [@Saima](https://discourse.slicer.org/u/Saima)
#### Post date: [June 24, 2018, 2:50am UTC](https://discourse.slicer.org/t/build-slicer-on-windows-10-failed/2232/26 "2018-06-24T02:50:58Z")

</div>

I build the slicer last night. I see the Slicer.exe now in superbuild folder.

But in the error list I also see the following errors:  
Severity Code Description Project File Line Suppression State  
Error LNK1104 cannot open file ‘Qt5::Widgets-NOTFOUND.obj’ [C:\Slicer-r26813\superbuild4.9\CTKAppLauncherLib-build\CTKAppLauncher.vcxproj] CTKAppLauncherLib C:\Slicer-r26813\superbuild4.9\LINK 1   
Severity Code Description Project File Line Suppression State  
Error MSB6006 “cmd.exe” exited with code 1. [C:\Slicer-r26813\superbuild4.9\CTK-build\CTK-build\Libs\Widgets\CTKWidgetsPythonQt.vcxproj] [C:\Slicer-r26813\superbuild4.9\CTK-build\CTK.vcxproj] CTK C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targets 171

I also see lots of warnings in the output window of visual studio:  
about 900+ for deprecated and some others.

During configuration I did what suggested by James.  
Thanks James

---

<div class="post-metadata">

### Author: ![Saima](https://avatars.discourse-cdn.com/v4/letter/s/9d8465/32.png) [@Saima](https://discourse.slicer.org/u/Saima)
#### Post date: [June 24, 2018, 7:01am UTC](https://discourse.slicer.org/t/build-slicer-on-windows-10-failed/2232/27 "2018-06-24T07:01:18Z")

</div>

While building Run\_Tests under cmake predefined target folder. I received following errors.  
The following tests FAILED:  
1\> 7 - py\_cmake\_slicer\_extensions\_index\_build\_without\_upload (Failed)  
1\> 8 - py\_cmake\_slicer\_extensions\_index\_build\_with\_upload (Failed)  
1\> 9 - py\_cmake\_slicer\_extensions\_index\_build\_with\_upload\_using\_ctest (Failed)  
1\> 10 - py\_cmake\_slicer\_extensions\_index\_build\_without\_upload\_using\_ctest (Failed)  
1\> 177 - qMRMLLayoutManagerTest1 (Failed)  
1\> 180 - qMRMLLayoutManagerTest4 (Failed)  
1\> 181 - qMRMLLayoutManagerVisibilityTest (Failed)  
1\> 363 - py\_NeurosurgicalPlanningTutorialMarkupsSelfTest (Failed)  
1\> 405 - qSlicerReformatModuleWidgetGenericTest (Failed)  
1\> 433 - py\_VolumeRenderingThreeDOnlyLayout (Timeout)  
1\> 438 - py\_nomainwindow\_qSlicerDataProbeModuleGenericTest (Failed)  
1\> 439 - py\_nomainwindow\_qSlicerDMRIInstallModuleGenericTest (Failed)  
1\> 440 - py\_nomainwindow\_qSlicerEditorModuleGenericTest (Failed)  
1\> 441 - py\_ThresholdThreadingTest (Failed)  
1\> 442 - py\_StandaloneEditorWidgetTest (Failed)  
1\> 443 - py\_nomainwindow\_qSlicerLabelStatisticsModuleGenericTest (Failed)  
1\> 445 - py\_nomainwindow\_qSlicerPerformanceTestsModuleGenericTest (Failed)  
1\> 446 - py\_nomainwindow\_qSlicerSampleDataModuleGenericTest (Failed)  
1\> 447 - py\_nomainwindow\_qSlicerScreenCaptureModuleGenericTest (Failed)  
1\> 450 - py\_nomainwindow\_qSlicerSegmentStatisticsModuleGenericTest (Failed)  
1\> 452 - py\_nomainwindow\_qSlicerSelfTestsModuleGenericTest (Failed)  
1\> 453 - py\_nomainwindow\_qSlicerSurfaceToolboxModuleGenericTest (Failed)  
1\> 454 - py\_nomainwindow\_qSlicerVectorToScalarVolumeModuleGenericTest (Failed)  
1\> 455 - py\_nomainwindow\_qSlicerExtensionWizardModuleGenericTest (Failed)  
1\> 456 - py\_nomainwindow\_qSlicerEndoscopyModuleGenericTest (Failed)  
1\> 457 - py\_nomainwindow\_qSlicerDICOMModuleGenericTest (Failed)  
1\> 458 - py\_nomainwindow\_qSlicerDICOMPatcherModuleGenericTest (Failed)  
1\> 459 - py\_DICOMPatcher (Failed)  
1\> 549 - slicer\_nomainwindow\_NoApplicationInformationOptionTest (Timeout)  
1\> 587 - py\_nomainwindow\_SlicerOptionDisableSettingsTest (Failed)  
1\> 603 - py\_nomainwindow\_DCMTKPrivateDictTest (Failed)  
1\> 609 - py\_DICOMReaders (Failed)  
1\> 612 - py\_SlicerMRBMultipleSaveRestoreLoopTest (Failed)  
1\> 614 - py\_SlicerMRBSaveRestoreCheckPathsTest (Failed)  
1\> 617 - py\_Charting (Failed)  
1\> 622 - py\_RSNAVisTutorial (Failed)  
1\> 630 - py\_JRC2013Vis (Failed)  
1\> 632 - py\_SubjectHierarchyGenericSelfTest (Failed)  
1\> 638 - py\_nomainwindow\_qSlicerMultiVolumeImporterModuleGenericTest (Failed)  
1\> 639 - py\_nomainwindow\_qSlicerSimpleFiltersModuleGenericTest (Failed)  
1\> 640 - py\_SimpleFiltersModuleTest (Failed)  
1\> 658 - EMSegCL\_Task\_BRAINS\_MRIHumanBrain\_scalartype\_float\_very\_small\_fetchData (Failed)  
1\> 659 - EMSegCL\_Task\_BRAINS\_MRIHumanBrain\_scalartype\_float\_very\_small (Failed)  
1\> 660 - EMSegCL\_Task\_BRAINS\_MRIHumanBrain\_scalartype\_uint\_very\_small\_fetchData (Failed)  
1\> 661 - EMSegCL\_Task\_BRAINS\_MRIHumanBrain\_scalartype\_uint\_very\_small (Failed)  
1\> 675 - py\_nomainwindow\_qSlicerLandmarkRegistrationModuleGenericTest (Failed)  
1\> 676 - py\_LandmarkRegistration (Failed)  
1\>Errors while running CTest  
1\>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targets(133,5): error MSB3073: The command “setlocal  
1\>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targets(133,5): error MSB3073: “C:\Program Files\CMake\bin\ctest.exe” --force-new-ctest-process -C Release  
1\>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targets(133,5): error MSB3073: if %errorlevel% neq 0 goto :cmEnd  
1\>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targets(133,5): error MSB3073: :cmEnd  
1\>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targets(133,5): error MSB3073: endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone  
1\>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targets(133,5): error MSB3073: :cmErrorLevel  
1\>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targets(133,5): error MSB3073: exit /b %1  
1\>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targets(133,5): error MSB3073: :cmDone  
1\>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targets(133,5): error MSB3073: if %errorlevel% neq 0 goto :VCEnd  
1\>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targets(133,5): error MSB3073: :VCEnd” exited with code 8.  
1\>Done building project “RUN\_TESTS.vcxproj” – FAILED.  
========== Build: 0 succeeded, 1 failed, 1 up-to-date, 0 skipped ==========

---

<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: [June 24, 2018, 12:39pm UTC](https://discourse.slicer.org/t/build-slicer-on-windows-10-failed/2232/28 "2018-06-24T12:39:18Z")

</div>

Have you started Visual Studio using `Slicer.exe --VisualStudio`?

[https://www.slicer.org/wiki/Documentation/Nightly/Developers/Tutorials/Debug\_Instructions#Using\_Visual\_Studio](https://www.slicer.org/wiki/Documentation/Nightly/Developers/Tutorials/Debug_Instructions#Using_Visual_Studio)

---

<div class="post-metadata">

### Author: ![Saima](https://avatars.discourse-cdn.com/v4/letter/s/9d8465/32.png) [@Saima](https://discourse.slicer.org/u/Saima)
#### Post date: [June 24, 2018, 2:45pm UTC](https://discourse.slicer.org/t/build-slicer-on-windows-10-failed/2232/29 "2018-06-24T14:45:42Z")

</div>

No I did not. I will do like you mentioned.

---

<div class="post-metadata">

### Author: ![jamesobutler](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jamesobutler/32/7511_2.png) [@jamesobutler](https://discourse.slicer.org/u/jamesobutler)
#### Post date: [June 24, 2018, 3:23pm UTC](https://discourse.slicer.org/t/build-slicer-on-windows-10-failed/2232/30 "2018-06-24T15:23:05Z")

</div>

If you are building Slicer nightly that uses Qt5, I should probably provide some additional hints regarding the installation of Qt.

With the Qt5 installer, choose Qt 5.10.1 with the option for the “MSVC 2015 x64” binaries since you are building with the msvc 2015 toolset(v140). You will also need to check the option to install “QWebEngine” under the 5.10.1 heading and I believe also the “Qt Script (deprecated)” option.

Note for Qt 5.11, QWebEngine is now only available for MSVC 2017 due to Chromium requirements, so QWebEngine won’t actually install even if it is checked and you choose the “MSVC 2015 x64” for Qt Core. So stick with Qt version 5.10.1 for now. I know this to work.

Slicer developers will need to confirm all dependicies can be built with MSVC 2017 if QWebEngine is to be used from the latest Qt5 versions.

---

<div class="post-metadata">

### Author: ![Saima](https://avatars.discourse-cdn.com/v4/letter/s/9d8465/32.png) [@Saima](https://discourse.slicer.org/u/Saima)
#### Post date: [June 25, 2018, 4:01am UTC](https://discourse.slicer.org/t/build-slicer-on-windows-10-failed/2232/31 "2018-06-25T04:01:28Z")

</div>

James, I have used qt5.10.1, Visual studio community 2017 with msvc 2015 toolset v140. Slicer source code downloaded using:  
svn co [GitHub - NA-MIC/svn.slicer.org-Slicer4: Archive of source code originally available at svn.slicer.org/Slicer4](http://svn.slicer.org/Slicer4/branches/Slicer-4-8) Slicer-r26813 -r 26813  
cmake 3.9.2.  
setting for qt5 in cmake.

I see the Slicer.exe and when I run it, it opens and show me the slicer application.

I did not build QT. Do I need to build it??? I just installed qt binary and provided paths to QT in cmake.

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/7/0/70f2122be1177eb22968d4e69cc266b5a529b902.png)

---

<div class="post-metadata">

### Author: ![jamesobutler](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jamesobutler/32/7511_2.png) [@jamesobutler](https://discourse.slicer.org/u/jamesobutler)
#### Post date: [June 25, 2018, 4:54am UTC](https://discourse.slicer.org/t/build-slicer-on-windows-10-failed/2232/32 "2018-06-25T04:54:21Z")

</div>

So you were able to build Slicer and the application runs successfully. Congrats!

I’m a little confused that your cmake is showing paths to msvc2017\_64 which would you would use if you were using the msvc2017 toolset(v141) and not msvc2015 toolset(v140), but if Slicer works I won’t complain.

You don’t have to manually build Qt to get a working build of Slicer. The downloaded binaries will work fine on their own. The qt-easy-build repo is for building Qt with OpenSSL support. I’ll provide an update to the windows powershell scripts for 5.10.0 in that repo soon.

---

<div class="post-metadata">

### Author: ![Saima](https://avatars.discourse-cdn.com/v4/letter/s/9d8465/32.png) [@Saima](https://discourse.slicer.org/u/Saima)
#### Post date: [June 25, 2018, 5:33am UTC](https://discourse.slicer.org/t/build-slicer-on-windows-10-failed/2232/33 "2018-06-25T05:33:13Z")

</div>

James, Slicer.exe opens like this. It successfully imported 130 modules out of 136

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/a/f/af165250c8c7dc94a00d0534aa483eb3fc35bfb7.png)

what I did wrong. any step need to be corrected to correct it??? I am also confused whether it is build correctly or not??

---

<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: [June 25, 2018, 10:22am UTC](https://discourse.slicer.org/t/build-slicer-on-windows-10-failed/2232/34 "2018-06-25T10:22:53Z")

</div>

I think full DICOM support (pyDICOM) requires building Slicer with OpenSSL support enabled.

---

<div class="post-metadata">

### Author: ![jamesobutler](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jamesobutler/32/7511_2.png) [@jamesobutler](https://discourse.slicer.org/u/jamesobutler)
#### Post date: [June 25, 2018, 12:17pm UTC](https://discourse.slicer.org/t/build-slicer-on-windows-10-failed/2232/35 "2018-06-25T12:17:28Z")

</div>

Saima,

You mentioned using code from a Slicer-48 branch with revision number 26813. This is source code for building Slicer Stable 4.8.1 which should be built with Qt4 though I think there was early support for Qt5. Instead, you should be building the most recent Slicer Nightly/Preview which is using the source code found in the master branch of the Slicer github repo. You don’t need to do anything with svn right now.

Also make sure you download and use Qt 5.10.1 msvc2015\_x64 with QWebEngine and Qt Script.

---

<div class="post-metadata">

### Author: ![Saima](https://avatars.discourse-cdn.com/v4/letter/s/9d8465/32.png) [@Saima](https://discourse.slicer.org/u/Saima)
#### Post date: [June 26, 2018, 11:53am UTC](https://discourse.slicer.org/t/build-slicer-on-windows-10-failed/2232/36 "2018-06-26T11:53:07Z")

</div>

> [@jamesobutler](#):
>
> should be building the most recent Slicer Nightly/Preview

how can I get the source code for latest slicer

---

<div class="post-metadata">

### Author: ![Saima](https://avatars.discourse-cdn.com/v4/letter/s/9d8465/32.png) [@Saima](https://discourse.slicer.org/u/Saima)
#### Post date: [June 26, 2018, 1:43pm UTC](https://discourse.slicer.org/t/build-slicer-on-windows-10-failed/2232/37 "2018-06-26T13:43:27Z")

</div>

I did configuration with ssl support on in cmake but no change.

---

<div class="post-metadata">

### Author: ![jamesobutler](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jamesobutler/32/7511_2.png) [@jamesobutler](https://discourse.slicer.org/u/jamesobutler)
#### Post date: [June 26, 2018, 1:59pm UTC](https://discourse.slicer.org/t/build-slicer-on-windows-10-failed/2232/38 "2018-06-26T13:59:22Z")

</div>

Hi Saima,

I provided information about where to get the source code for the latest Slicer:

> Instead, you should be building the most recent Slicer Nightly/Preview which is using the source code found in the master branch of the Slicer github repo.

Now I didn’t provide a link which I can do now ([Slicer Github Repo](https://github.com/Slicer/Slicer)), but since right now you lack this introductory knowledge about Github, I **highly** suggest that you proceed development using the latest [Slicer binaries](https://download.slicer.org/) and extending on the Slicer platform using [Slicer Python Scripting](https://www.slicer.org/wiki/Documentation/Nightly/Developers/Python_scripting) as suggested by @lassoan .

---

<div class="post-metadata">

### Author: ![timeanddoctor](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/timeanddoctor/32/5839_2.png) [@timeanddoctor](https://discourse.slicer.org/u/timeanddoctor)
#### Post date: [July 12, 2018, 8:05am UTC](https://discourse.slicer.org/t/build-slicer-on-windows-10-failed/2232/39 "2018-07-12T08:05:52Z")

</div>

I built slicer in Win10 firstly. what can I do after following this error.  
Thanks!

 ![%E6%8D%95%E8%8E%B7](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/e/5/e5dd40212a439756b491eb33956590802f002711.png)

---

<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: [July 12, 2018, 1:06pm UTC](https://discourse.slicer.org/t/build-slicer-on-windows-10-failed/2232/40 "2018-07-12T13:06:01Z")

</div>

It all looks good! Where do you see an error?

Your source directory path (D:/slicer/Slicer) is a bit too long, which may cause problem later. I would recommend to use D:/D/S4 for source and D:/D/S4D (for debug) or D:/D/S4R (for release) binary directory.

[Previous page](https://discourse.slicer.org/t/build-slicer-on-windows-10-failed/2232.md?page=1)

[Next page](https://discourse.slicer.org/t/build-slicer-on-windows-10-failed/2232.md?page=3)
