# Visual Studio 2015 Build Fail

**URL:** <https://discourse.slicer.org/t/visual-studio-2015-build-fail/6133>\
**Category:** Development\
**Tags:** build\
**Created:** [March 13, 2019, 1:27pm UTC](https://discourse.slicer.org/t/visual-studio-2015-build-fail/6133 "2019-03-13T13:27:12Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![triple\_axel](https://avatars.discourse-cdn.com/v4/letter/t/e56c9b/32.png) [@triple\_axel](https://discourse.slicer.org/u/triple_axel)\
**Post date:** [March 13, 2019, 1:27pm UTC](https://discourse.slicer.org/t/visual-studio-2015-build-fail/6133/1 "2019-03-13T13:27:13Z")

</div>

Machine: Windows 10  
Compiler: “Visual Studio 14 2015”  
Hi, I am having issues attempting to build the latest stable version of Slicer (Slicer 4.10.1). I have attempted git cloning, configuring, generating, and building 3 times and I get these same errors, I was wondering if anyone has encountered any before and how to solve them?

1. Multiple “error 9009” problems:  

2. Module machine x86 conflicts with with target machine type x64 for SimpleITK  

3. This CTK issue, with I think has to do with the “error 9009” problems:  

Thanks a lot!

---

<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:** [March 13, 2019, 1:35pm UTC](https://discourse.slicer.org/t/visual-studio-2015-build-fail/6133/2 "2019-03-13T13:35:23Z")

</div>

You only showed the superbuild result, which does not contain information about why the particular subproject failed to build. Open the .sln file of the _first_ failed subproject and build it to see the actual errors.

---

<div class="post-metadata">

**Author:** ![cpinter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/cpinter/32/7995_2.png) [@cpinter](https://discourse.slicer.org/u/cpinter)\
**Post date:** [March 13, 2019, 1:43pm UTC](https://discourse.slicer.org/t/visual-studio-2015-build-fail/6133/3 "2019-03-13T13:43:20Z")

</div>

> [@triple\_axel](#):
>
> Visual Studio 14 2015

Please make sure that your configuration is actually “Visual Studio 14 2015 Win64”, and not the 32 bit one indicated above.

---

<div class="post-metadata">

**Author:** ![triple\_axel](https://avatars.discourse-cdn.com/v4/letter/t/e56c9b/32.png) [@triple\_axel](https://discourse.slicer.org/u/triple_axel)\
**Post date:** [March 13, 2019, 1:56pm UTC](https://discourse.slicer.org/t/visual-studio-2015-build-fail/6133/4 "2019-03-13T13:56:37Z")

</div>

Hi, I built the first subproject (CTKAppLauncherLib) that failed and got this error:

1\>------ Build started: Project: CTKAppLauncherLib, Configuration: Release x64 ------  
1\> Creating directories for ‘CTKAppLauncherLib’  
1\> Building Custom Rule C:/S4/CMakeLists.txt  
1\> CMake does not need to re-run because C:/S4R/CMakeFiles/generate.stamp is up-to-date.  
1\> Performing download step (git clone) for ‘CTKAppLauncherLib’  
1\> – Avoiding repeated git clone, stamp file is up to date: ‘C:/S4R/CTKAppLauncherLib-prefix/src/CTKAppLauncherLib-stamp/CTKAppLauncherLib-gitclone-lastrun.txt’  
1\> Performing update step for ‘CTKAppLauncherLib’  
1\> No patch step for ‘CTKAppLauncherLib’  
1\> Generate version-CTKAppLauncherLib.txt and license-CTKAppLauncherLib.txt  
1\> Performing configure step for ‘CTKAppLauncherLib’  
1\> loading initial cache file C:/S4R/CTKAppLauncherLib-prefix/tmp/CTKAppLauncherLib-cache-Release.cmake  
1\> – Selecting Windows SDK version to target Windows 10.0.17763.  
1\> – CTKAppLauncher version: 0.1.25-gec98a50  
1\> – Configuring done  
1\> – Generating done  
1\> – Build files have been written to: C:/S4R/CTKAppLauncherLib-build  
1\> Performing build step for ‘CTKAppLauncherLib’  
1\> Microsoft ® Build Engine version 14.0.25420.1  
1\> Copyright © Microsoft Corporation. All rights reserved.  
1\>  
1\> Generating moc\_ctkAppLauncherEnvironment.cpp  
1\> ‘C:\ProgramFiles’ is not recognized as an internal or external command,  
1\> operable program or batch file.  
1\>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targets(171,5): error MSB6006: “cmd.exe” exited with code 9009. [C:\S4R\CTKAppLauncherLib-build\Base\CTKAppLauncherLib.vcxproj]  
========== Build: 0 succeeded, 1 failed, 1 up-to-date, 0 skipped ==========

Additionally, I configured keeping in mind that “x64” must be chosen.

---

<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:** [March 13, 2019, 2:04pm UTC](https://discourse.slicer.org/t/visual-studio-2015-build-fail/6133/5 "2019-03-13T14:04:37Z")

</div>

> [@triple\_axel](#):
>
> Generating moc\_ctkAppLauncherEnvironment.cpp

Qt moc (meta object compiler) fails. Which Qt version do you use? Where is it installed? Do you have a “C:\ProgramFiles” folder? Can you find `ProgramFiles` text any of the \*.txt, \*.cmake, \*.in files in the build tree?

---

<div class="post-metadata">

**Author:** ![triple\_axel](https://avatars.discourse-cdn.com/v4/letter/t/e56c9b/32.png) [@triple\_axel](https://discourse.slicer.org/u/triple_axel)\
**Post date:** [March 13, 2019, 2:17pm UTC](https://discourse.slicer.org/t/visual-studio-2015-build-fail/6133/6 "2019-03-13T14:17:20Z")

</div>

I installed Qt 5.10.0 x64 and its installed in a folder called “C:\ProgramFiles(x86)”. I do not have a “C:\ProgramFiles” folder.The only other ones I have are “C:\Program Files” and “C\Program Files (x86)”. I will try reinstalling Qt if anything perhaps went wrong with my installation.

---

<div class="post-metadata">

**Author:** ![cpinter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/cpinter/32/7995_2.png) [@cpinter](https://discourse.slicer.org/u/cpinter)\
**Post date:** [March 13, 2019, 2:28pm UTC](https://discourse.slicer.org/t/visual-studio-2015-build-fail/6133/7 "2019-03-13T14:28:44Z")

</div>

> [@triple\_axel](#):
>
> Additionally, I configured keeping in mind that “x64” must be chosen

I think you refer to the build configuration within Visual Studio. It is not enough, you need to make sure the the right configuration is used for CMake. For example

`cmake -G "Visual Studio 14 2015 Win64" -DQt5_DIR=C:/Qt/5.10.1/msvc2015_64/lib/cmake/Qt5 c:/d/Slicer`

The moc problem might be related, so please do a completely clean build with fresh CMake configuration and generation, and let us know.

---

<div class="post-metadata">

**Author:** ![triple\_axel](https://avatars.discourse-cdn.com/v4/letter/t/e56c9b/32.png) [@triple\_axel](https://discourse.slicer.org/u/triple_axel)\
**Post date:** [March 14, 2019, 4:54pm UTC](https://discourse.slicer.org/t/visual-studio-2015-build-fail/6133/8 "2019-03-14T16:54:36Z")

</div>

After I rebuilt it (keeping in mind that x64 is chosen for my configuration and redownloading qt) I was able to successfully build slicer although 1 subproject failed being "module machine type “x86” conflicted with target machine type “x64” for the Simple-ITK build.

I think the problem was that I previously downloaded a 5.10.0 qt mirror because the qt installer was always failing for me, but I attempted to redownload qt yesterday using the same installer, and it worked just fine.

Thanks for all the help!!
