# Error when building the latest build (2020-03-25)

**URL:** <https://discourse.slicer.org/t/error-when-building-the-latest-build-2020-03-25/10858>\
**Category:** Development\
**Tags:** build, itk\
**Created:** [March 26, 2020, 6:04pm UTC](https://discourse.slicer.org/t/error-when-building-the-latest-build-2020-03-25/10858 "2020-03-26T18:04:39Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Fangwen\_Zhai](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/fangwen_zhai/32/6001_2.png) [@Fangwen\_Zhai](https://discourse.slicer.org/u/Fangwen_Zhai)\
**Post date:** [March 26, 2020, 6:04pm UTC](https://discourse.slicer.org/t/error-when-building-the-latest-build-2020-03-25/10858/1 "2020-03-26T18:04:39Z")

</div>

I just tried building the [latest code](https://github.com/Slicer/Slicer/commit/90a0ba80ff91ca250abede254262c6313b180e52) and got several errors. My building environment includes VS 2017, windows 10. After some searching, I found these errors are all related to itkv5 compatibility as listed below.

> Error C2039 ‘SetNumberOfThreads’: is not a member of ‘itk::MultiThreaderBase’ ExpertAutomatedRegistrationLib …\slicersources-src\modules\cli\expertautomatedregistration\itkregistrationhelper\itkImageToImageRegistrationMethod.txx 39

In the ITK [migration guide](https://github.com/InsightSoftwareConsortium/ITK/blob/master/Documentation/ITK5MigrationGuide.md), it is recommended to change ‘SetNumberOfThreads’ to ‘SetNumberOfWorkUnits’.

And the following errors maybe related to the ITK\_LEGACY\_REMOVE flag which is still off in External\_ITK.cmake.

> Error C3668 ‘itk::InverseDisplacementFieldTransform\<double,3\>::ComputeJacobianWithRespectToPosition’: method with override specifier ‘override’ did not override any base class methods MRMLCore (Core-Libs\MRMLCore\MRMLCore) …\slicersources-src\libs\mrml\core\vtkITKTransformInverse.h 198   
> Error C3668 ‘itk::InverseDisplacementFieldTransform\<double,3\>::ComputeInverseJacobianWithRespectToPosition’: method with override specifier ‘override’ did not override any base class methods MRMLCore (Core-Libs\MRMLCore\MRMLCore) …\slicersources-src\libs\mrml\core\vtkITKTransformInverse.h 216   
> Error C3668 ‘itk::InverseThinPlateSplineKernelTransform\<double,3\>::ComputeJacobianWithRespectToPosition’: method with override specifier ‘override’ did not override any base class methods MRMLCore (Core-Libs\MRMLCore\MRMLCore) …\slicersources-src\libs\mrml\core\vtkITKTransformInverse.h 283   
> Error C2440 ‘initializing’: cannot convert from ‘const std::list\<itk::SmartPointer\<itk::TransformBaseTemplate\>,std::allocator\<\_Ty\>\> \*’ to ‘TransformListType \*’ MRMLCore (Core-Libs\MRMLCore\MRMLCore) …\slicersources-src\Libs\MRML\Core\vtkMRMLTransformStorageNode.cxx 166   
> Error C2039 ‘TerminateThread’: is not a member of ‘itk::PlatformMultiThreader’ SlicerBaseLogic …\slicersources-src\Base\Logic\vtkSlicerApplicationLogic.cxx 93   
> Error C2039 ‘SpawnThread’: is not a member of ‘itk::PlatformMultiThreader’ SlicerBaseLogic …\slicersources-src\Base\Logic\vtkSlicerApplicationLogic.cxx 187

Any suggestions or workaround?

---

<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 26, 2020, 6:53pm UTC](https://discourse.slicer.org/t/error-when-building-the-latest-build-2020-03-25/10858/2 "2020-03-26T18:53:04Z")

</div>

Do you build Slicer according to the [build instructions](https://www.slicer.org/wiki/Documentation/Nightly/Developers/Build_Instructions) or do you have a special configuration (such as trying to build Slicer with an externally built ITK)?

---

<div class="post-metadata">

**Author:** ![Fangwen\_Zhai](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/fangwen_zhai/32/6001_2.png) [@Fangwen\_Zhai](https://discourse.slicer.org/u/Fangwen_Zhai)\
**Post date:** [March 26, 2020, 7:10pm UTC](https://discourse.slicer.org/t/error-when-building-the-latest-build-2020-03-25/10858/3 "2020-03-26T19:10:58Z")

</div>

Yes, I followed the build instructions. When building the nightly version around December 2019, everything was OK. I notice that the superbuild’s ITK has been updated from pre-v5.1b01 to v5.1rc01 in January and it seems to be the reason.

---

<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 26, 2020, 7:40pm UTC](https://discourse.slicer.org/t/error-when-building-the-latest-build-2020-03-25/10858/4 "2020-03-26T19:40:43Z")

</div>

If you built Slicer months ago then you need to rebuild it from scratch (delete the entire Slicer build folder, which contains ITK, VTK, … build trees).

---

<div class="post-metadata">

**Author:** ![Fangwen\_Zhai](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/fangwen_zhai/32/6001_2.png) [@Fangwen\_Zhai](https://discourse.slicer.org/u/Fangwen_Zhai)\
**Post date:** [March 26, 2020, 8:23pm UTC](https://discourse.slicer.org/t/error-when-building-the-latest-build-2020-03-25/10858/5 "2020-03-26T20:23:42Z")

</div>

Thanks, I’ll try again.

---

<div class="post-metadata">

**Author:** ![Fangwen\_Zhai](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/fangwen_zhai/32/6001_2.png) [@Fangwen\_Zhai](https://discourse.slicer.org/u/Fangwen_Zhai)\
**Post date:** [March 27, 2020, 8:06am UTC](https://discourse.slicer.org/t/error-when-building-the-latest-build-2020-03-25/10858/6 "2020-03-27T08:06:23Z")

</div>

After cleaning the build directory and rebuild the whole project, now it works.
