I tried to build the latest Slicer on Windows using CMake 3.26.3 and Visual Studio 2022 17.6.1 with the prerequisites have met (Windows — 3D Slicer documentation)
CMake configure and generate the Release build were done without any error
However, during the Release by Visual Studio there was an error
I’ve built Slicer on Windows thousands of times but I haven’t run into this issue.
Are you building the latest Slicer main branch?
What is the build toolset version?
Mine is 14.34.31933, as in the top-level CMakeCache.txt I have a line like this: CMAKE_AR:FILEPATH=C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.34.31933/bin/Hostx64/x64/lib.exe
New compiler versions often need some time to get stable, so it is usually better not to use the very latest version. You can downgrade to toolset version 14.34, by opening the Visual Studio Installer application, choose Modify, choose “Individual components” tab, and unselect MSVC… build tools (Latest)" and select a 14.34 instead.
You can also open VTK build settings in CMake and disable all modules that refer to IOSS.
@jcfr It seems that this problematic private copy of the fmt library has been removed in VTK-9.2.0 (in September 2022). Could we rebase Slicer’s VTK on a recent VTK version? The amount of backported fixes (and the lots more fixes that we have not backported) is becoming a bit worrying.
@jcfr we’ll probably get just more and more reports like this (unless Microsoft very quickly releases a new compiler revision). To avoid frustrating many developers, could we upgrade Slicer’s VTK? Recent VTK versions don’t contain the file that crashes the MSVC compiler.