After going through countless hardships, I have finally solved most of the compilation problems, but there are still some problems that are difficult for me. I would like to ask how to solve these problems?
in ITK project
itkAffineTransform.hxx(294): error C2244: “slicer_itk::AffineTransform<TParametersValueType,VDimension>::Metric”: Cannot match function definition with existing declaration
… a lot of C2244 error
in ITK project
itkInterpolateImageFunction.h(79): error C2653: “InputImageType”: Not a class or namespace name
…a lot of C2653 error
in ITK project
itkCenteredSimilarity2DTransform.h(99): error C2146: Syntax error: Missing ‘;’
…a lot of C2146 error
in ITK project
itkCenteredSimilarity2DTransform.h(99): error C4430: Missing type descriptor - assumed to be int. Note: C++does not support default ints
Here are some information you mentioned:
OS: windows11 professional 22H2
compiler: visual studio 2017 enterprise edition 15.9.56
CMake: 3.26.0
Slicer: latest main unknown version
Qt: 5.15.2
git: 2.42.0 windows.2
python: 3.9
A key point: set _LINKER_FLAGS_DEBUG /INCREMENT:NO
Hope the above information can help you understand my problem
Visual Studio 2017 is not tested anymore as mentioned in Windows — 3D Slicer documentation. Maybe something has changed in the dependency tree and we will need to update that note in the build instructions. The Slicer ITK version says that Visual Studio 15.7 with the v141 toolset or later should work as it conformed to the C++11/14/17 standard.
Would you be able to download and install Visual Studio 2022 and use its default v143 toolset instead?
Also note that ITK has removed support for Visual Studio 2017 in v5.4rc01. Slicer updates the ITK version that it uses every so often, so Visual Studio 2017 will likely be dropped in Slicer soon as well.
We suggest you try to stick as close to the latest releases of everything as possible and not rely on older versions or compilers or you are likely to get stuck and not get any new fixes or features. Of course we don’t break things on purpose but often there are good reasons why people drop support for old compilers.
Yes the ITK version is associated with the Slicer version. Slicer has required C++17 starting with Slicer 5.2.0 so you would have to go all the way back to the Slicer 5.0.x series of code to likely compile successfully using Visual Studio 2017. I would highly discourage this if you’re able to download and install Visual Studio 2022.
Slicer 5.0.x was released 1.5 years ago and you won’t get all the improvements and bug fixes since then unless you spend time trying to backport small changes. Since Slicer developers have limited resources generally we can only support efforts for the latest Slicer Stable (currently 5.4.0) or the latest Slicer preview.