# Error Compiling ITK 5.3.0

**URL:** <https://discourse.itk.org/t/error-compiling-itk-5-3-0/6333>\
**Category:** Engineering\
**Created:** [December 1, 2023, 10:43pm UTC](https://discourse.itk.org/t/error-compiling-itk-5-3-0/6333 "2023-12-01T22:43:46Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![imikejackson](https://discourse.itk.org/user_avatar/discourse.itk.org/imikejackson/32/35_2.png) [@imikejackson](https://discourse.itk.org/u/imikejackson)\
**Post date:** [December 1, 2023, 10:43pm UTC](https://discourse.itk.org/t/error-compiling-itk-5-3-0/6333/1 "2023-12-01T22:43:46Z")

</div>

We have some C++ software that was compiling fine against ITK 5.2.1. In an effort to get up to date I am trying to compile against ITK 5.3.0 using Visual Studio 17 2022. I am getting the following compile error.

```auto
FAILED: complex/Plugins/ITKImageProcessing/CMakeFiles/ITKImageProcessing.dir/Debug/src/ITKImageProcessing/Filters/ITKMorphologicalWatershedImage.cpp.obj
C:\PROGRA~1\MIB055~1\2022\COMMUN~1\VC\Tools\MSVC\1438~1.331\bin\Hostx64\x64\cl.exe /nologo /TP -DCOMPLEX_ENABLE_MULTICORE -DEbsdLib_BUILT_AS_DYNAMIC_LIB -DFMT_SHARED -DH5Support_USE_MUTEX -DH5_BUILT_AS_DYNAMIC_LIB -DH5_USE_110_API -DITKImageProcessing_EXPORTS -DTBB_USE_DEBUG -D_SILENCE_CXX17_RESULT_OF_DEPRECATION_WARNING -DCMAKE_INTDIR=\"Debug\" -IE:\Workspace1\complex\src\Plugins\ITKImageProcessing\src -IE:\Workspace1\DREAM3D-Build\NX-ninja-v143\complex\Plugins\ITKImageProcessing\generated -IE:\Workspace1\complex\src -IE:\Workspace1\DREAM3D-Build\NX-ninja-v143\complex\generated -external:IE:\Workspace1\vcpkg-installed-v143\x64-windows\include -external:IE:\Workspace1\vcpkg-installed-v143\x64-windows\share\eigen3\..\..\include\eigen3 -external:IE:\Workspace1\vcpkg-installed-v143\x64-windows\include\ITK-5.3 -external:W0 /DWIN32 /D_WINDOWS /EHsc /Ob0 /Od /RTC1 -std:c++17 -MDd -Zi /wd4275 /wd4251 /we4706 /we4715 /we4456 /we4457 /we4458 /we4459 /permissive- /MP /bigobj /showIncludes /Focomplex\Plugins\ITKImageProcessing\CMakeFiles\ITKImageProcessing.dir\Debug\src\ITKImageProcessing\Filters\ITKMorphologicalWatershedImage.cpp.obj /Fdcomplex\Plugins\ITKImageProcessing\CMakeFiles\ITKImageProcessing.dir\Debug\ /FS -c E:\Workspace1\complex\src\Plugins\ITKImageProcessing\src\ITKImageProcessing\Filters\ITKMorphologicalWatershedImage.cpp
E:\Workspace1\vcpkg-installed-v143\x64-windows\include\ITK-5.3\itkShapedNeighborhoodIterator.h(182): error C2516: 'itk::ShapedNeighborhoodIterator<TImage,TBoundaryCondition>::ConstIterator': is not a legal base class
E:\Workspace1\vcpkg-installed-v143\x64-windows\include\ITK-5.3\itkShapedNeighborhoodIterator.h(171): note: see declaration of 'itk::ShapedNeighborhoodIterator<TImage,TBoundaryCondition>::ConstIterator'
E:\Workspace1\vcpkg-installed-v143\x64-windows\include\ITK-5.3\itkShapedNeighborhoodIterator.h(182): note: the template instantiation context (the oldest one first) is
E:\Workspace1\vcpkg-installed-v143\x64-windows\include\ITK-5.3\itkShapedNeighborhoodIterator.h(265): note: see reference to class template instantiation 'itk::ShapedNeighborhoodIterator<TImage,TBoundaryCondition>' being compiled        
E:\Workspace1\vcpkg-installed-v143\x64-windows\include\ITK-5.3\itkShapedNeighborhoodIterator.h(209): note: see reference to class template instantiation 'itk::ShapedNeighborhoodIterator<TImage,TBoundaryCondition>::Iterator' being compiled

```

Has anyone seen anything like this by rare chance? I looked at the ITK code and it all looks legit but the Visual Studio compilers do not like something about it. Clang on macOS didn’t seem to have an issue.

---

<div class="post-metadata">

**Author:** ![dzenanz](https://discourse.itk.org/user_avatar/discourse.itk.org/dzenanz/32/1093_2.png) [@dzenanz](https://discourse.itk.org/u/dzenanz)\
**Post date:** [December 1, 2023, 11:22pm UTC](https://discourse.itk.org/t/error-compiling-itk-5-3-0/6333/2 "2023-12-01T23:22:44Z")

</div>

I remember @Niels_Dekker wrestling with something similar.

---

<div class="post-metadata">

**Author:** ![imikejackson](https://discourse.itk.org/user_avatar/discourse.itk.org/imikejackson/32/35_2.png) [@imikejackson](https://discourse.itk.org/u/imikejackson)\
**Post date:** [December 2, 2023, 5:51pm UTC](https://discourse.itk.org/t/error-compiling-itk-5-3-0/6333/3 "2023-12-02T17:51:00Z")

</div>

Was there an issue or something fixed? This is a blocker for us to get a new build of our application built under Anaconda (they use ITK 5.3.0)

---

<div class="post-metadata">

**Author:** ![phcerdan](https://discourse.itk.org/user_avatar/discourse.itk.org/phcerdan/32/286_2.png) [@phcerdan](https://discourse.itk.org/u/phcerdan)\
**Post date:** [December 2, 2023, 6:15pm UTC](https://discourse.itk.org/t/error-compiling-itk-5-3-0/6333/4 "2023-12-02T18:15:02Z")

</div>

See this post: [ITK build Error in itk::ShapedNeighborhoodIterator](https://discourse.itk.org/t/itk-build-error-in-itk-shapedneighborhooditerator/4861)

It was merged into main 2023-01-04 by @Niels_Dekker.

> <https://github.com/phcerdan/ITK/commit/687f51e64287615aac4108f867c264ac4e53dd07>
>
> Works around compile errors that appeared using Visual C++ compiler flag
> \`/permi…ssive-\` ("Conformance mode"), using either VS2019 or VS2022, saying:
> 
> \> error C2516: 'ConstIterator': is not a legal base class
> \> error C2516: 'GlobalDataStruct': is not a legal base class
> 
> Originally reported by Astha, March 14, 2022, and further discussed at
> "ITK build Error in itk::ShapedNeighborhoodIterator",
> https://discourse.itk.org/t/itk-build-error-in-itk-shapedneighborhooditerator/4861

---

<div class="post-metadata">

**Author:** ![imikejackson](https://discourse.itk.org/user_avatar/discourse.itk.org/imikejackson/32/35_2.png) [@imikejackson](https://discourse.itk.org/u/imikejackson)\
**Post date:** [December 2, 2023, 6:34pm UTC](https://discourse.itk.org/t/error-compiling-itk-5-3-0/6333/5 "2023-12-02T18:34:29Z")

</div>

Cool. Nice to know my patch agrees with others. Were there plans for a 5.3.x release by chance? Anaconda only has 5.3.0 which will still fail on our builds so I am stuck in limbo waiting for ITK to release something and Anaconda to catch up? I would have thought there to be some .patch releases this year at some point.

---

<div class="post-metadata">

**Author:** ![phcerdan](https://discourse.itk.org/user_avatar/discourse.itk.org/phcerdan/32/286_2.png) [@phcerdan](https://discourse.itk.org/u/phcerdan)\
**Post date:** [December 2, 2023, 6:37pm UTC](https://discourse.itk.org/t/error-compiling-itk-5-3-0/6333/6 "2023-12-02T18:37:54Z")

</div>

Good question, I don’t think so, but there is a 5.4 release candidate.
