# \[Windows\] Debug SimpleITK build failed

**URL:** <https://discourse.slicer.org/t/windows-debug-simpleitk-build-failed/11914>\
**Category:** Development\
**Created:** [June 7, 2020, 5:30pm UTC](https://discourse.slicer.org/t/windows-debug-simpleitk-build-failed/11914 "2020-06-07T17:30:04Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![adamrankin](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/adamrankin/32/155_2.png) [@adamrankin](https://discourse.slicer.org/u/adamrankin)\
**Post date:** [June 7, 2020, 5:30pm UTC](https://discourse.slicer.org/t/windows-debug-simpleitk-build-failed/11914/1 "2020-06-07T17:30:04Z")

</div>

Hello all,

My debug build of Slicer fails on SimpleITK looking for python36\_d.lib, is this a known issue?

I’ve scanned [3D slicer Windows 10 Build Fail (only SimpleITK project)](https://discourse.slicer.org/t/3d-slicer-windows-10-build-fail-only-simpleitk-project/6727/25) and that doesn’t seem to be related.

Qt 5.15.0, CMake 3.17.3, VS2019, v140 toolkit

[Edit: Deleted directories as I ran out of disk space, will get Git hash shortly]

Adam

---

<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 7, 2020, 6:29pm UTC](https://discourse.slicer.org/t/windows-debug-simpleitk-build-failed/11914/2 "2020-06-07T18:29:04Z")

</div>

That seems most like what was discussed in [https://github.com/Slicer/Slicer/issues/4898#issuecomment-623453879](https://github.com/Slicer/Slicer/issues/4898#issuecomment-623453879) and I don’t believe it was ever fully resolved.

---

<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 7, 2020, 6:35pm UTC](https://discourse.slicer.org/t/windows-debug-simpleitk-build-failed/11914/3 "2020-06-07T18:35:39Z")

</div>

Yes, it looks like the same issue. It would be better to continue the discussion in the issue tracker to keep all related information in one place.

---

<div class="post-metadata">

**Author:** ![adamrankin](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/adamrankin/32/155_2.png) [@adamrankin](https://discourse.slicer.org/u/adamrankin)\
**Post date:** [June 9, 2020, 2:42pm UTC](https://discourse.slicer.org/t/windows-debug-simpleitk-build-failed/11914/4 "2020-06-09T14:42:56Z")

</div>

Hi Andras,

After further exploration, I tried reverting this change ( **Edit: I reverted only the change to External\_SimpleITK.cmake** ):

> <https://github.com/Slicer/Slicer/commit/daee0f4ec1431fa44c39388dd82145f44be216f9#diff-109aeb3808fbb9cd5a014863e7556a16R113>

and re-doing a clean build. It succeeded. Somehow having the variable be empty doesn’t trigger the #pragma in the python headers to include the debug .lib

My steps:

1. Checkout latest ([f665904](https://github.com/Slicer/Slicer/commit/f665904f69c68710958406c2be4b43bc675e9211) at the time)
2. CMake and superbuild! Fail with “cannot find python36\_d.lib”
3. Delete SimpleITK, SimpleITK-build, etc… (all folders relating to SimpleITK)
4. CMake superbuild again, recreate fresh SimpleITK and SimpleITK prefix dirs
5. Build SimpleITK-download from superbuild project
6. Build SimpleITK from superbuild project, success

Any thoughts? Could setting the debug lib variable somehow cause the preprocessor defines to change?

---

<div class="post-metadata">

**Author:** ![adamrankin](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/adamrankin/32/155_2.png) [@adamrankin](https://discourse.slicer.org/u/adamrankin)\
**Post date:** [June 11, 2020, 1:00am UTC](https://discourse.slicer.org/t/windows-debug-simpleitk-build-failed/11914/5 "2020-06-11T01:00:43Z")

</div>

Nope! Just did another clean build and it worked. Yay…

---

<div class="post-metadata">

**Author:** ![sunshine\_boycn](https://avatars.discourse-cdn.com/v4/letter/s/ed8c4c/32.png) [@sunshine\_boycn](https://discourse.slicer.org/u/sunshine_boycn)\
**Post date:** [June 23, 2020, 12:51am UTC](https://discourse.slicer.org/t/windows-debug-simpleitk-build-failed/11914/6 "2020-06-23T00:51:58Z")

</div>

> [@adamrankin](#):
>
> superbuild

Have you every solve this problem? I met the exactly same problem with you under the same environment setting.

I noticed that there might be several solutions mentioned above, which one could solve the problem?

I was wondering why can’t we just change the linked python lib to the release version of python for simpleITK in CMakeLists.txt to solve the bugs forever?

---

<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, 2020, 1:04am UTC](https://discourse.slicer.org/t/windows-debug-simpleitk-build-failed/11914/7 "2020-06-23T01:04:15Z")

</div>

The problem is fixed now (in [this commit](https://github.com/Slicer/Slicer/commit/49f3f0b8c02621baf6bad4e98c0b45c2ef30cd52)). Update to the latest master version and rebuild Slicer from scratch (delete the entire build folder).
