# Error building slicer on Windows 10 (CTK problem?)

**URL:** https://discourse.slicer.org/t/error-building-slicer-on-windows-10-ctk-problem/8028
**Category:** Support
**Tags:** build, ctk
**Created:** [August 14, 2019, 3:19pm UTC](https://discourse.slicer.org/t/error-building-slicer-on-windows-10-ctk-problem/8028 "2019-08-14T15:19:06Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![aalarcon96](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/aalarcon96/32/4942_2.png) [@aalarcon96](https://discourse.slicer.org/u/aalarcon96)
#### Post date: [August 14, 2019, 3:19pm UTC](https://discourse.slicer.org/t/error-building-slicer-on-windows-10-ctk-problem/8028/1 "2019-08-14T15:19:06Z")

</div>

Hi,

I am trying to build slicer on Windows 10, using Visual Studios 2019 and Qt 5.10. I came across this error after building “ALL\_BUILD” in release mode. Could it be that I needed to download some package beforehand?

47\>CMake Error at CMakeLists.txt:792 (find\_package):  
47\> By not providing “FindCTK.cmake” in CMAKE\_MODULE\_PATH this project has  
47\> asked CMake to find a package configuration file provided by “CTK”, but  
47\> CMake did not find one.  
47\>  
47\> Could not find a package configuration file provided by “CTK” with any of  
47\> the following names:  
47\>  
47\> CTKConfig.cmake  
47\> ctk-config.cmake  
47\>  
47\> Add the installation prefix of “CTK” to CMAKE\_PREFIX\_PATH or set “CTK\_DIR”  
47\> to a directory containing one of the above files. If “CTK” provides a  
47\> separate development package or SDK, be sure it has been installed.  
47\>  
47\>  
47\>-- Configuring incomplete, errors occurred!  
47\>See also “C:/Angela/S4/S4-Superbuild/Slicer-build/CMakeFiles/CMakeOutput.log”.  
47\>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(220,5): error MSB6006: “cmd.exe” exited with code 1.  
47\>Done building project “Slicer.vcxproj” – FAILED.  
48\>------ Build started: Project: ALL\_BUILD, Configuration: Release x64 ------  
48\>Building Custom Rule C:/Angela/S4/S4-s/CMakeLists.txt  
========== Build: 41 succeeded, 7 failed, 0 up-to-date, 0 skipped ==========

Thanks in advance!

---

<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: [August 14, 2019, 4:04pm UTC](https://discourse.slicer.org/t/error-building-slicer-on-windows-10-ctk-problem/8028/2 "2019-08-14T16:04:28Z")

</div>

When configuring Slicer with CMake did you set to use the v140 toolset since you are using Visual Studio 2019?

It would be part of this section in the build instructions:  
[https://www.slicer.org/wiki/Documentation/Nightly/Developers/Build\_Instructions#Experimental.2Fdeprecated\_build\_environments](https://www.slicer.org/wiki/Documentation/Nightly/Developers/Build_Instructions#Experimental.2Fdeprecated_build_environments)

---

<div class="post-metadata">

### Author: ![aalarcon96](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/aalarcon96/32/4942_2.png) [@aalarcon96](https://discourse.slicer.org/u/aalarcon96)
#### Post date: [August 14, 2019, 4:10pm UTC](https://discourse.slicer.org/t/error-building-slicer-on-windows-10-ctk-problem/8028/3 "2019-08-14T16:10:29Z")

</div>

I am not sure if I did. Is there a way to check? Sorry, I am very new to this.

---

<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: [August 14, 2019, 4:26pm UTC](https://discourse.slicer.org/t/error-building-slicer-on-windows-10-ctk-problem/8028/4 "2019-08-14T16:26:25Z")

</div>

If you open up the main solution where you have ALL\_BUILD and all of the other projects it should have “(Visual Studio 2015)” next to the project names if you have set the toolset correctly.

If you are using a recent CMakeGUI you would’ve specified Visual Studio 2019 as your generator, then you define platform and toolset below. So “X64” and then “v140”.

---

<div class="post-metadata">

### Author: ![aalarcon96](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/aalarcon96/32/4942_2.png) [@aalarcon96](https://discourse.slicer.org/u/aalarcon96)
#### Post date: [August 14, 2019, 4:44pm UTC](https://discourse.slicer.org/t/error-building-slicer-on-windows-10-ctk-problem/8028/5 "2019-08-14T16:44:24Z")

</div>

They don’t have “(Visual Studio 2015)” next to the project names.

 ![Capture](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/8/3/834c1dcd108b7b308d19648882049f36d814ed47.png)  
I chose Visual Studios 2019 as my generator, but I did not define the platform nor toolset.
