Errors with building slicercat template

Operating system: windows
Slicer version: 4.11
I am trying to build the SlicerCAT as explained in https://blog.kitware.com/slicercat-creating-custom-applications-based-on-3d-slicer/ by following the exact instructions here Windows — 3D Slicer documentation

I have got error and warnings about CTK, VTK and simpleITK projects in the last step of the build process in VS while I haven’t change anything in CMakeLists.txt. would you please tell me how to fix it?

Details about error and warnings related to CTK, VTK and simpleITK projects
|Error|MSB8066|Custom build for 'E:\D\S4R\CMakeFiles\edbed8a7c8f5e3496e69de9e4425bff5\Slicer-mkdir.rule;E:\D\S4R\CMakeFiles\edbed8a7c8f5e3496e69de9e4425bff5\Slicer-download.rule;E:\D\S4R\CMakeFiles\edbed8a7c8f5e3496e69de9e4425bff5\Slicer-update.rule;E:\D\S4R\CMakeFiles\edbed8a7c8f5e3496e69de9e4425bff5\Slicer-patch.rule;E:\D\S4R\CMakeFiles\edbed8a7c8f5e3496e69de9e4425bff5\Slicer-configure.rule;E:\D\S4R\CMakeFiles\edbed8a7c8f5e3496e69de9e4425bff5\Slicer-build.rule;E:\D\S4R\CMakeFiles\edbed8a7c8f5e3496e69de9e4425bff5\Slicer-forceconfigure.rule;E:\D\S4R\CMakeFiles\edbed8a7c8f5e3496e69de9e4425bff5\Slicer-install.rule;E:\D\S4R\CMakeFiles\a292924acdc90ab5003f524bcf7a9fa8\Slicer-complete.rule;E:\D\S4R\CMakeFiles\18dd41b82dccc87fa779d30114192df1\Slicer.rule;E:\D\S4\Slicer\CMakeLists.txt' exited with code 1.|Slicer|C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets|242||
|Error|MSB8066|Custom build for 'E:\D\S4R\CMakeFiles\eec0fafea484c1c9bf8d0dbc735ed3d8\SimpleITK-mkdir.rule;E:\D\S4R\CMakeFiles\eec0fafea484c1c9bf8d0dbc735ed3d8\SimpleITK-download.rule;E:\D\S4R\CMakeFiles\eec0fafea484c1c9bf8d0dbc735ed3d8\SimpleITK-update.rule;E:\D\S4R\CMakeFiles\eec0fafea484c1c9bf8d0dbc735ed3d8\SimpleITK-patch.rule;E:\D\S4R\CMakeFiles\eec0fafea484c1c9bf8d0dbc735ed3d8\SimpleITK-configure.rule;E:\D\S4R\CMakeFiles\eec0fafea484c1c9bf8d0dbc735ed3d8\SimpleITK-build.rule;E:\D\S4R\CMakeFiles\eec0fafea484c1c9bf8d0dbc735ed3d8\SimpleITK-install.rule;E:\D\S4R\CMakeFiles\a292924acdc90ab5003f524bcf7a9fa8\SimpleITK-complete.rule;E:\D\S4R\CMakeFiles\18dd41b82dccc87fa779d30114192df1\SimpleITK.rule;E:\D\S4\Slicer\CMakeLists.txt' exited with code 1.|SimpleITK|C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets|242||
|Error|MSB8066|Custom build for 'E:\D\S4R\SimpleITK-build\CMakeFiles\e434fb47607d62ac9904788467fcbb5e\SimpleITK-mkdir.rule;E:\D\S4R\SimpleITK-build\CMakeFiles\e434fb47607d62ac9904788467fcbb5e\SimpleITK-download.rule;E:\D\S4R\SimpleITK-build\CMakeFiles\e434fb47607d62ac9904788467fcbb5e\SimpleITK-update.rule;E:\D\S4R\SimpleITK-build\CMakeFiles\e434fb47607d62ac9904788467fcbb5e\SimpleITK-patch.rule;E:\D\S4R\SimpleITK-build\CMakeFiles\e434fb47607d62ac9904788467fcbb5e\SimpleITK-configure.rule;E:\D\S4R\SimpleITK-build\CMakeFiles\e434fb47607d62ac9904788467fcbb5e\SimpleITK-forcebuild.rule;E:\D\S4R\SimpleITK-build\CMakeFiles\e434fb47607d62ac9904788467fcbb5e\SimpleITK-build.rule;E:\D\S4R\SimpleITK-build\CMakeFiles\e434fb47607d62ac9904788467fcbb5e\SimpleITK-install.rule;E:\D\S4R\SimpleITK-build\CMakeFiles\9be4e433cd02aef5b6487fefef7ada35\SimpleITK-complete.rule;E:\D\S4R\SimpleITK-build\CMakeFiles\bb9f6672bdc8a30b78dccc82e0a89b19\SimpleITK.rule;E:\D\S4R\SimpleITK\SuperBuild\CMakeLists.txt' exited with code 1. [E:\D\S4R\SimpleITK-build\SimpleITK.vcxproj]|SimpleITK|C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets|242||
|Error|LNK1181|cannot open input file 'E:\D\S4R\ITK-build\lib\Release\itksys-5.2.lib' [E:\D\S4R\SimpleITK-build\SimpleITK-build\Code\Common\src\SimpleITKCommon.vcxproj] [E:\D\S4R\SimpleITK-build\SimpleITK.vcxproj]|SimpleITK|E:\D\S4R\LINK|1||
|Error|MSB8066|Custom build for 'E:\D\S4R\CMakeFiles\99511604aac5c76d372eaa262a119621\SlicerExecutionModel-mkdir.rule;E:\D\S4R\CMakeFiles\99511604aac5c76d372eaa262a119621\SlicerExecutionModel-download.rule;E:\D\S4R\CMakeFiles\99511604aac5c76d372eaa262a119621\SlicerExecutionModel-update.rule;E:\D\S4R\CMakeFiles\99511604aac5c76d372eaa262a119621\SlicerExecutionModel-patch.rule;E:\D\S4R\CMakeFiles\99511604aac5c76d372eaa262a119621\SlicerExecutionModel-configure.rule;E:\D\S4R\CMakeFiles\99511604aac5c76d372eaa262a119621\SlicerExecutionModel-build.rule;E:\D\S4R\CMakeFiles\99511604aac5c76d372eaa262a119621\SlicerExecutionModel-generate_project_description.rule;E:\D\S4R\CMakeFiles\99511604aac5c76d372eaa262a119621\SlicerExecutionModel-install.rule;E:\D\S4R\CMakeFiles\a292924acdc90ab5003f524bcf7a9fa8\SlicerExecutionModel-complete.rule;E:\D\S4R\CMakeFiles\18dd41b82dccc87fa779d30114192df1\SlicerExecutionModel.rule;E:\D\S4\Slicer\CMakeLists.txt' exited with code 1.|SlicerExecutionModel|C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets|242||
|Error|LNK1181|cannot open input file 'E:\D\S4R\ITK-build\lib\Release\itksys-5.2.lib' [E:\D\S4R\SlicerExecutionModel-build\ModuleDescriptionParser\ModuleDescriptionParser.vcxproj]|SlicerExecutionModel|E:\D\S4R\LINK|1||
|Error|MSB8066|Custom build for 'E:\D\S4R\CMakeFiles\9bad8873f29c688a199c24d814eb83b7\CTK-mkdir.rule;E:\D\S4R\CMakeFiles\9bad8873f29c688a199c24d814eb83b7\CTK-download.rule;E:\D\S4R\CMakeFiles\9bad8873f29c688a199c24d814eb83b7\CTK-update.rule;E:\D\S4R\CMakeFiles\9bad8873f29c688a199c24d814eb83b7\CTK-patch.rule;E:\D\S4R\CMakeFiles\9bad8873f29c688a199c24d814eb83b7\CTK-configure.rule;E:\D\S4R\CMakeFiles\9bad8873f29c688a199c24d814eb83b7\CTK-build.rule;E:\D\S4R\CMakeFiles\9bad8873f29c688a199c24d814eb83b7\CTK-generate_project_description.rule;E:\D\S4R\CMakeFiles\9bad8873f29c688a199c24d814eb83b7\CTK-install.rule;E:\D\S4R\CMakeFiles\a292924acdc90ab5003f524bcf7a9fa8\CTK-complete.rule;E:\D\S4R\CMakeFiles\18dd41b82dccc87fa779d30114192df1\CTK.rule;E:\D\S4\Slicer\CMakeLists.txt' exited with code 1.|CTK|C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets|242||
|Error|MSB8066|Custom build for 'E:\D\S4R\CTK-build\CMakeFiles\6897e4f0eca62e72c3a61e1ea7f571d2\CTK-mkdir.rule;E:\D\S4R\CTK-build\CMakeFiles\6897e4f0eca62e72c3a61e1ea7f571d2\CTK-download.rule;E:\D\S4R\CTK-build\CMakeFiles\6897e4f0eca62e72c3a61e1ea7f571d2\CTK-update.rule;E:\D\S4R\CTK-build\CMakeFiles\6897e4f0eca62e72c3a61e1ea7f571d2\CTK-patch.rule;E:\D\S4R\CTK-build\CMakeFiles\6897e4f0eca62e72c3a61e1ea7f571d2\CTK-configure.rule;E:\D\S4R\CTK-build\CMakeFiles\6897e4f0eca62e72c3a61e1ea7f571d2\CTK-build.rule;E:\D\S4R\CTK-build\CMakeFiles\6897e4f0eca62e72c3a61e1ea7f571d2\CTK-forceconfigure.rule;E:\D\S4R\CTK-build\CMakeFiles\6897e4f0eca62e72c3a61e1ea7f571d2\CTK-install.rule;E:\D\S4R\CTK-build\CMakeFiles\5ecc0909b7e629936336667a3198cb7f\CTK-complete.rule;E:\D\S4R\CTK-build\CMakeFiles\133301bfd8d7306c1cff6360a6c6b40c\CTK.rule;E:\D\S4R\CTK\CMakeLists.txt' exited with code 1. [E:\D\S4R\CTK-build\CTK.vcxproj]|CTK|C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets|242||
Severity Code Description Project File Line Suppression State
Error MSB8066 Custom build for ‘E:\D\S4R\CMakeFiles\edbed8a7c8f5e3496e69de9e4425bff5\Slicer-mkdir.rule;E:\D\S4R\CMakeFiles\edbed8a7c8f5e3496e69de9e4425bff5\Slicer-download.rule;E:\D\S4R\CMakeFiles\edbed8a7c8f5e3496e69de9e4425bff5\Slicer-update.rule;E:\D\S4R\CMakeFiles\edbed8a7c8f5e3496e69de9e4425bff5\Slicer-patch.rule;E:\D\S4R\CMakeFiles\edbed8a7c8f5e3496e69de9e4425bff5\Slicer-configure.rule;E:\D\S4R\CMakeFiles\edbed8a7c8f5e3496e69de9e4425bff5\Slicer-build.rule;E:\D\S4R\CMakeFiles\edbed8a7c8f5e3496e69de9e4425bff5\Slicer-forceconfigure.rule;E:\D\S4R\CMakeFiles\edbed8a7c8f5e3496e69de9e4425bff5\Slicer-install.rule;E:\D\S4R\CMakeFiles\a292924acdc90ab5003f524bcf7a9fa8\Slicer-complete.rule;E:\D\S4R\CMakeFiles\18dd41b82dccc87fa779d30114192df1\Slicer.rule;E:\D\S4\Slicer\CMakeLists.txt’ exited with code 1. Slicer C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets 242
Error MSB8066 Custom build for ‘E:\D\S4R\CMakeFiles\eec0fafea484c1c9bf8d0dbc735ed3d8\SimpleITK-mkdir.rule;E:\D\S4R\CMakeFiles\eec0fafea484c1c9bf8d0dbc735ed3d8\SimpleITK-download.rule;E:\D\S4R\CMakeFiles\eec0fafea484c1c9bf8d0dbc735ed3d8\SimpleITK-update.rule;E:\D\S4R\CMakeFiles\eec0fafea484c1c9bf8d0dbc735ed3d8\SimpleITK-patch.rule;E:\D\S4R\CMakeFiles\eec0fafea484c1c9bf8d0dbc735ed3d8\SimpleITK-configure.rule;E:\D\S4R\CMakeFiles\eec0fafea484c1c9bf8d0dbc735ed3d8\SimpleITK-build.rule;E:\D\S4R\CMakeFiles\eec0fafea484c1c9bf8d0dbc735ed3d8\SimpleITK-install.rule;E:\D\S4R\CMakeFiles\a292924acdc90ab5003f524bcf7a9fa8\SimpleITK-complete.rule;E:\D\S4R\CMakeFiles\18dd41b82dccc87fa779d30114192df1\SimpleITK.rule;E:\D\S4\Slicer\CMakeLists.txt’ exited with code 1. SimpleITK C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets 242
Error MSB8066 Custom build for ‘E:\D\S4R\SimpleITK-build\CMakeFiles\e434fb47607d62ac9904788467fcbb5e\SimpleITK-mkdir.rule;E:\D\S4R\SimpleITK-build\CMakeFiles\e434fb47607d62ac9904788467fcbb5e\SimpleITK-download.rule;E:\D\S4R\SimpleITK-build\CMakeFiles\e434fb47607d62ac9904788467fcbb5e\SimpleITK-update.rule;E:\D\S4R\SimpleITK-build\CMakeFiles\e434fb47607d62ac9904788467fcbb5e\SimpleITK-patch.rule;E:\D\S4R\SimpleITK-build\CMakeFiles\e434fb47607d62ac9904788467fcbb5e\SimpleITK-configure.rule;E:\D\S4R\SimpleITK-build\CMakeFiles\e434fb47607d62ac9904788467fcbb5e\SimpleITK-forcebuild.rule;E:\D\S4R\SimpleITK-build\CMakeFiles\e434fb47607d62ac9904788467fcbb5e\SimpleITK-build.rule;E:\D\S4R\SimpleITK-build\CMakeFiles\e434fb47607d62ac9904788467fcbb5e\SimpleITK-install.rule;E:\D\S4R\SimpleITK-build\CMakeFiles\9be4e433cd02aef5b6487fefef7ada35\SimpleITK-complete.rule;E:\D\S4R\SimpleITK-build\CMakeFiles\bb9f6672bdc8a30b78dccc82e0a89b19\SimpleITK.rule;E:\D\S4R\SimpleITK\SuperBuild\CMakeLists.txt’ exited with code 1. [E:\D\S4R\SimpleITK-build\SimpleITK.vcxproj] SimpleITK C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets 242
Error LNK1181 cannot open input file ‘E:\D\S4R\ITK-build\lib\Release\itksys-5.2.lib’ [E:\D\S4R\SimpleITK-build\SimpleITK-build\Code\Common\src\SimpleITKCommon.vcxproj] [E:\D\S4R\SimpleITK-build\SimpleITK.vcxproj] SimpleITK E:\D\S4R\LINK 1
Error MSB8066 Custom build for ‘E:\D\S4R\CMakeFiles\99511604aac5c76d372eaa262a119621\SlicerExecutionModel-mkdir.rule;E:\D\S4R\CMakeFiles\99511604aac5c76d372eaa262a119621\SlicerExecutionModel-download.rule;E:\D\S4R\CMakeFiles\99511604aac5c76d372eaa262a119621\SlicerExecutionModel-update.rule;E:\D\S4R\CMakeFiles\99511604aac5c76d372eaa262a119621\SlicerExecutionModel-patch.rule;E:\D\S4R\CMakeFiles\99511604aac5c76d372eaa262a119621\SlicerExecutionModel-configure.rule;E:\D\S4R\CMakeFiles\99511604aac5c76d372eaa262a119621\SlicerExecutionModel-build.rule;E:\D\S4R\CMakeFiles\99511604aac5c76d372eaa262a119621\SlicerExecutionModel-generate_project_description.rule;E:\D\S4R\CMakeFiles\99511604aac5c76d372eaa262a119621\SlicerExecutionModel-install.rule;E:\D\S4R\CMakeFiles\a292924acdc90ab5003f524bcf7a9fa8\SlicerExecutionModel-complete.rule;E:\D\S4R\CMakeFiles\18dd41b82dccc87fa779d30114192df1\SlicerExecutionModel.rule;E:\D\S4\Slicer\CMakeLists.txt’ exited with code 1. SlicerExecutionModel C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets 242
Error LNK1181 cannot open input file ‘E:\D\S4R\ITK-build\lib\Release\itksys-5.2.lib’ [E:\D\S4R\SlicerExecutionModel-build\ModuleDescriptionParser\ModuleDescriptionParser.vcxproj] SlicerExecutionModel E:\D\S4R\LINK 1
Error MSB8066 Custom build for ‘E:\D\S4R\CMakeFiles\9bad8873f29c688a199c24d814eb83b7\CTK-mkdir.rule;E:\D\S4R\CMakeFiles\9bad8873f29c688a199c24d814eb83b7\CTK-download.rule;E:\D\S4R\CMakeFiles\9bad8873f29c688a199c24d814eb83b7\CTK-update.rule;E:\D\S4R\CMakeFiles\9bad8873f29c688a199c24d814eb83b7\CTK-patch.rule;E:\D\S4R\CMakeFiles\9bad8873f29c688a199c24d814eb83b7\CTK-configure.rule;E:\D\S4R\CMakeFiles\9bad8873f29c688a199c24d814eb83b7\CTK-build.rule;E:\D\S4R\CMakeFiles\9bad8873f29c688a199c24d814eb83b7\CTK-generate_project_description.rule;E:\D\S4R\CMakeFiles\9bad8873f29c688a199c24d814eb83b7\CTK-install.rule;E:\D\S4R\CMakeFiles\a292924acdc90ab5003f524bcf7a9fa8\CTK-complete.rule;E:\D\S4R\CMakeFiles\18dd41b82dccc87fa779d30114192df1\CTK.rule;E:\D\S4\Slicer\CMakeLists.txt’ exited with code 1. CTK C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets 242
Error MSB8066 Custom build for ‘E:\D\S4R\CTK-build\CMakeFiles\6897e4f0eca62e72c3a61e1ea7f571d2\CTK-mkdir.rule;E:\D\S4R\CTK-build\CMakeFiles\6897e4f0eca62e72c3a61e1ea7f571d2\CTK-download.rule;E:\D\S4R\CTK-build\CMakeFiles\6897e4f0eca62e72c3a61e1ea7f571d2\CTK-update.rule;E:\D\S4R\CTK-build\CMakeFiles\6897e4f0eca62e72c3a61e1ea7f571d2\CTK-patch.rule;E:\D\S4R\CTK-build\CMakeFiles\6897e4f0eca62e72c3a61e1ea7f571d2\CTK-configure.rule;E:\D\S4R\CTK-build\CMakeFiles\6897e4f0eca62e72c3a61e1ea7f571d2\CTK-build.rule;E:\D\S4R\CTK-build\CMakeFiles\6897e4f0eca62e72c3a61e1ea7f571d2\CTK-forceconfigure.rule;E:\D\S4R\CTK-build\CMakeFiles\6897e4f0eca62e72c3a61e1ea7f571d2\CTK-install.rule;E:\D\S4R\CTK-build\CMakeFiles\5ecc0909b7e629936336667a3198cb7f\CTK-complete.rule;E:\D\S4R\CTK-build\CMakeFiles\133301bfd8d7306c1cff6360a6c6b40c\CTK.rule;E:\D\S4R\CTK\CMakeLists.txt’ exited with code 1. [E:\D\S4R\CTK-build\CTK.vcxproj] CTK C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets 242
Warning C4996 ‘QTime::start’: Use QElapsedTimer instead [E:\D\S4R\CTK-build\CTK-build\Libs\Visualization\VTK\Widgets\CTKVisualizationVTKWidgets.vcxproj] [E:\D\S4R\CTK-build\CTK.vcxproj] CTK E:\D\S4R\CTK\Libs\Visualization\VTK\Widgets\ctkVTKAbstractView.cpp 206
Warning C4302 ‘reinterpret_cast’: truncation from ‘void *’ to ‘long’ [E:\D\S4R\CTK-build\CTK-build\Libs\Visualization\VTK\Widgets\CTKVisualizationVTKWidgets.vcxproj] [E:\D\S4R\CTK-build\CTK.vcxproj] CTK E:\D\S4R\CTK\Libs\Visualization\VTK\Widgets\ctkVTKScalarsToColorsWidget.cpp 299
Warning C4302 ‘reinterpret_cast’: truncation from ‘void *’ to ‘unsigned long’ [E:\D\S4R\CTK-build\CTK-build\Libs\Visualization\VTK\Widgets\CTKVisualizationVTKWidgets.vcxproj] [E:\D\S4R\CTK-build\CTK.vcxproj] CTK E:\D\S4R\CTK\Libs\Visualization\VTK\Widgets\ctkVTKScalarsToColorsView.cpp 559
Warning C4996 ‘Qt::MidButton’: MidButton is deprecated. Use MiddleButton instead [E:\D\S4R\CTK-build\CTK-build\Libs\Visualization\VTK\Widgets\CTKVisualizationVTKWidgets.vcxproj] [E:\D\S4R\CTK-build\CTK.vcxproj] CTK E:\D\S4R\CTK\Libs\Visualization\VTK\Widgets\ctkVTKChartView.cpp 428
Error LNK1181 cannot open input file ‘E:\D\S4R\ITK-build\lib\Release\ITKCommon-5.2.lib’ [E:\D\S4R\CTK-build\CTK-build\Libs\ImageProcessing\ITK\Core\CTKImageProcessingITKCore.vcxproj] [E:\D\S4R\CTK-build\CTK.vcxproj] CTK E:\D\S4R\LINK 1

Please use the latest master version of the custom application template with the latest master version of Slicer and let us know if you run into any issues.

Hello Andras,
Here is the steps of the build process that I’ve followed … (in a screen record)

Still getting these errors and warnings:

Warning	MSB8064	Custom build for item "E:\D\S4R\CTK-build\CMakeFiles\6897e4f0eca62e72c3a61e1ea7f571d2\CTK-build.rule" succeeded, but specified dependency "e:\d\s4r\ctk-build\ctk-prefix\src\ctk-stamp\release\ctk-configure" does not exist. This may cause incremental build to work incorrectly. [E:\D\S4R\CTK-build\CTK.vcxproj]	CTK	C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets	242	
Warning	C4996	'PyEval_CallObjectWithKeywords': deprecated in 3.9 [E:\D\S4R\VTK-build\Wrapping\PythonCore\WrappingPythonCore.vcxproj]	VTK	E:\D\S4R\VTK\Wrapping\PythonCore\vtkPythonUtil.cxx	567	
Warning	C4100	'globals': unreferenced formal parameter [E:\D\S4R\VTK-build\Wrapping\PythonCore\WrappingPythonCore.vcxproj]	VTK	E:\D\S4R\VTK\Wrapping\PythonCore\vtkPythonUtil.cxx	893	
Warning	C4996	'PyEval_CallObjectWithKeywords': deprecated in 3.9 [E:\D\S4R\VTK-build\Wrapping\PythonCore\WrappingPythonCore.vcxproj]	VTK	E:\D\S4R\VTK\Wrapping\PythonCore\vtkPythonUtil.cxx	1086	
Warning	MSB8065	Custom build for item "E:\D\S4R\CTK-build\CMakeFiles\6897e4f0eca62e72c3a61e1ea7f571d2\CTK-configure.rule" succeeded, but specified output "e:\d\s4r\ctk-build\ctk-prefix\src\ctk-stamp\release\ctk-configure" has not been created. This may cause incremental build to work incorrectly. [E:\D\S4R\CTK-build\CTK.vcxproj]	CTK	C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets	242	
Warning	C4293	'<<': shift count negative or too big, undefined behavior [E:\D\S4R\SimpleITK-build\SimpleITK-build\Code\BasicFilters\src\SimpleITK_ITKLabelMap.vcxproj] [E:\D\S4R\SimpleITK-build\SimpleITK.vcxproj]	SimpleITK	E:\D\S4R\ITK\Modules\Filtering\LabelMap\include\itkStatisticsLabelMapFilter.h	142	
Warning	C4293	'<<': shift count negative or too big, undefined behavior [E:\D\S4R\SimpleITK-build\SimpleITK-build\Code\BasicFilters\src\SimpleITK_ITKLabelMap.vcxproj] [E:\D\S4R\SimpleITK-build\SimpleITK.vcxproj]	SimpleITK	E:\D\S4R\ITK\Modules\Filtering\LabelMap\include\itkStatisticsLabelMapFilter.hxx	77	
Error	LNK1181	cannot open input file 'optimized.lib' [E:\D\S4R\SimpleITK-build\SimpleITK-build\Wrapping\Python\SimpleITK_PYTHON.vcxproj] [E:\D\S4R\SimpleITK-build\SimpleITK.vcxproj]	SimpleITK	E:\D\S4R\LINK	1	
Error	MSB8066	Custom build for 'E:\D\S4R\SimpleITK-build\CMakeFiles\e434fb47607d62ac9904788467fcbb5e\SimpleITK-forcebuild.rule;E:\D\S4R\SimpleITK-build\CMakeFiles\e434fb47607d62ac9904788467fcbb5e\SimpleITK-build.rule;E:\D\S4R\SimpleITK-build\CMakeFiles\e434fb47607d62ac9904788467fcbb5e\SimpleITK-install.rule;E:\D\S4R\SimpleITK-build\CMakeFiles\9be4e433cd02aef5b6487fefef7ada35\SimpleITK-complete.rule;E:\D\S4R\SimpleITK-build\CMakeFiles\bb9f6672bdc8a30b78dccc82e0a89b19\SimpleITK.rule;E:\D\S4R\SimpleITK\SuperBuild\CMakeLists.txt' exited with code 1. [E:\D\S4R\SimpleITK-build\SimpleITK.vcxproj]	SimpleITK	C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets	242	
Error	MSB8066	Custom build for 'E:\D\S4R\CMakeFiles\eec0fafea484c1c9bf8d0dbc735ed3d8\SimpleITK-configure.rule;E:\D\S4R\CMakeFiles\eec0fafea484c1c9bf8d0dbc735ed3d8\SimpleITK-build.rule;E:\D\S4R\CMakeFiles\eec0fafea484c1c9bf8d0dbc735ed3d8\SimpleITK-install.rule;E:\D\S4R\CMakeFiles\a292924acdc90ab5003f524bcf7a9fa8\SimpleITK-complete.rule;E:\D\S4R\CMakeFiles\18dd41b82dccc87fa779d30114192df1\SimpleITK.rule;E:\D\S4\Slicer\CMakeLists.txt' exited with code 1.	SimpleITK	C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets	242	
Error	MSB8066	Custom build for 'E:\D\S4R\CMakeFiles\edbed8a7c8f5e3496e69de9e4425bff5\Slicer-configure.rule;E:\D\S4R\CMakeFiles\edbed8a7c8f5e3496e69de9e4425bff5\Slicer-build.rule;E:\D\S4R\CMakeFiles\edbed8a7c8f5e3496e69de9e4425bff5\Slicer-forceconfigure.rule;E:\D\S4R\CMakeFiles\edbed8a7c8f5e3496e69de9e4425bff5\Slicer-install.rule;E:\D\S4R\CMakeFiles\a292924acdc90ab5003f524bcf7a9fa8\Slicer-complete.rule;E:\D\S4R\CMakeFiles\18dd41b82dccc87fa779d30114192df1\Slicer.rule;E:\D\S4\Slicer\CMakeLists.txt' exited with code 1.	Slicer	C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets	242

There are two issues being discussed here:

  1. Build error when creating, and then building a custom application following instruction outline in https://www.kitware.com/slicercat-creating-custom-applications-based-on-3d-slicer/

  2. Build errors when building Slicer following instructions described on Windows — 3D Slicer documentation

@Mrwa_Awoda

If you would like to create custom Slicer-based application, successfully building Slicer itself will allow to confirm your development environment is valid.

I suggest we focus on building Slicer first.

In your last post, you copied some error messages. That said, we are missing the actual errors … which is probably reported earlier in the output.

It looks like SimpleITK failed to build … after opening the top-level solution file (C:\D\S4R\Slicer.sln) and selecting Release, I suggest you right click on SimpleITK and select Project Only then Build Only SimpleITK

This should help identify the SimpleITK specific errors.

Hi jcfr,
thanks for your response…
here what i get …

The relevant message seems to be:

LINK : falal error LNK1181:  cannot open input file 'optimized.lib'

Note: While screenshot helps understand the context. In addition, it is a good practice to copy the error message as text. This allow to easy copy/past the message (or part of it), and also ensure the error will be indexed by the forum search engine)

Question 1: Could you also check if ITK build successfully following the same approach ?

Question 2: Did you customize the PATH environment variable on your workstation ?

Question 3: Is there any registry entries associated with one of these key ? (see details and screenshot below)

  • HKEY_LOCAL_MACHINE\Software\Kitware\CMake\Packages\<PackageName>
  • HKEY_CURRENT_USER\Software\Kitware\CMake\Packages\<PackageName>

CMake User and system package registry

I am wondering if some other package built and exported on your system are interfering with one of the build-system.

We usually make sure no packages built by Slicer are exported to the CMake registry but it is possible we missed something with the recent updates.

More details can be found here: cmake-packages(7) — CMake 3.22.2 Documentation

Registry editor is found on windows typing regedit in the windows menu

image

1 Like

thanks for your patience…
here what i get after building the ITK…

Build started...
1>------ Build started: Project: ITK, Configuration: Release x64 ------
1>Performing update step for 'ITK'
1>No patch step for 'ITK'
1>Performing configure step for 'ITK'
1>loading initial cache file E:/D/S4R/ITK-prefix/tmp/ITK-cache-Release.cmake
1>-- Selecting Windows SDK version 10.0.19041.0 to target Windows 10.0.19043.
1>error launching git: The process cannot access the file because it is being used by another process.
1>
1>CMake Error at CMake/ITKModuleRemote.cmake:91 (message):
1>  Failed to get the hash for
1>  https://github.com/ntustison/ITKAdaptiveDenoising.git HEAD
1>Call Stack (most recent call first):
1>  CMake/ITKModuleRemote.cmake:137 (_git_update)
1>  CMake/ITKModuleRemote.cmake:236 (_fetch_with_git)
1>  Modules/Remote/AdaptiveDenoising.remote.cmake:44 (itk_fetch_module)
1>  Modules/Remote/CMakeLists.txt:10 (include)
1>
1>
1>-- Configuring incomplete, errors occurred!
1>See also "E:/D/S4R/ITK-build/CMakeFiles/CMakeOutput.log".
1>See also "E:/D/S4R/ITK-build/CMakeFiles/CMakeError.log".
1>C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(242,5): error MSB8066: Custom build for 'E:\D\S4R\CMakeFiles\5192aa6b129195b05a27c64828fbcc8c\ITK-update.rule;E:\D\S4R\CMakeFiles\5192aa6b129195b05a27c64828fbcc8c\ITK-patch.rule;E:\D\S4R\CMakeFiles\5192aa6b129195b05a27c64828fbcc8c\ITK-configure.rule;E:\D\S4R\CMakeFiles\5192aa6b129195b05a27c64828fbcc8c\ITK-build.rule;E:\D\S4R\CMakeFiles\5192aa6b129195b05a27c64828fbcc8c\ITK-install.rule;E:\D\S4R\CMakeFiles\a292924acdc90ab5003f524bcf7a9fa8\ITK-complete.rule;E:\D\S4R\CMakeFiles\18dd41b82dccc87fa779d30114192df1\ITK.rule' exited with code 1.
1>Done building project "ITK.vcxproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

there are no other packages have biult or exported in the CMake registry :

This seems to indicate you have either another instance of Visual Studio, a text editor or a terminal open in the directory … I suggest you close the applications and try again.

Right, ItK build completed successfully!

unfortunately, still having warnings after building CTK:

.

.

Completed ‘CTK’

1>C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(242,5): warning MSB8065: Custom build for item “E:\D\S4R\CTK-build\CMakeFiles\6897e4f0eca62e72c3a61e1ea7f571d2\CTK-configure.rule” succeeded, but specified output “e:\d\s4r\ctk-build\ctk-prefix\src\ctk-stamp\release\ctk-configure” has not been created. This may cause incremental build to work incorrectly. [E:\D\S4R\CTK-build\CTK.vcxproj]

1>C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(242,5): warning MSB8064: Custom build for item “E:\D\S4R\CTK-build\CMakeFiles\6897e4f0eca62e72c3a61e1ea7f571d2\CTK-build.rule” succeeded, but specified dependency “e:\d\s4r\ctk-build\ctk-prefix\src\ctk-stamp\release\ctk-configure” does not exist. This may cause incremental build to work incorrectly. [E:\D\S4R\CTK-build\CTK.vcxproj]

1>No install step for ‘CTK’

1>Completed ‘CTK’

1>Done building project “CTK.vcxproj”.

========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========

and with building Slicer as well:

.

.

1>-- --------------------------------------------------

1>-- Configuring Slicer application library: qSlicerApp

1>-- --------------------------------------------------

1>-- Setting Slicer DESCRIPTION_SUMMARY to ‘Medical Visualization and Processing Environment for Research’

1>-- Setting Slicer DESCRIPTION_FILE to ‘E:/D/S4/Slicer/README.txt’

1>-- --------------------------------------------------

1>-- Configuring Slicer application: SlicerApp

1>-- --------------------------------------------------

1>-- Setting Slicer APPLICATION_NAME to ‘Slicer’

1>-- Setting Slicer LAUNCHER_SPLASHSCREEN_FILE to ‘E:/D/S4/Slicer/Applications/SlicerApp/Resources/Images/Slicer-SplashScreen.png’

1>-- Setting Slicer APPLE_ICON_FILE to ‘E:/D/S4/Slicer/Applications/SlicerApp/Resources/Slicer.icns’

1>-- Setting Slicer WIN_ICON_FILE to ‘E:/D/S4/Slicer/Applications/SlicerApp/Resources/Slicer.ico’

1>-- Setting Slicer LICENSE_FILE to ‘E:/D/S4/Slicer/License.txt’

1>-- Setting Slicer executable name to ‘SlicerApp-real.exe’

1>-- Setting Slicer EXECUTABLE to ‘E:/D/S4R/Slicer-build/bin/SlicerApp-real.exe’

1>CMake Error at CMake/SlicerMacroBuildApplication.cmake:479 (get_filename_component):

1> get_filename_component unknown component optimized

1>Call Stack (most recent call first):

1> Applications/SlicerApp/CMakeLists.txt:66 (slicerMacroBuildApplication)

1>

1>

1>-- Configuring incomplete, errors occurred!

1>See also “E:/D/S4R/Slicer-build/CMakeFiles/CMakeOutput.log”.

1>See also “E:/D/S4R/Slicer-build/CMakeFiles/CMakeError.log”.

1>C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(242,5): error MSB8066: Custom build for ‘E:\D\S4R\CMakeFiles\edbed8a7c8f5e3496e69de9e4425bff5\Slicer-configure.rule;E:\D\S4R\CMakeFiles\edbed8a7c8f5e3496e69de9e4425bff5\Slicer-build.rule;E:\D\S4R\CMakeFiles\edbed8a7c8f5e3496e69de9e4425bff5\Slicer-forceconfigure.rule;E:\D\S4R\CMakeFiles\edbed8a7c8f5e3496e69de9e4425bff5\Slicer-install.rule;E:\D\S4R\CMakeFiles\a292924acdc90ab5003f524bcf7a9fa8\Slicer-complete.rule;E:\D\S4R\CMakeFiles\18dd41b82dccc87fa779d30114192df1\Slicer.rule’ exited with code 1.

1>Done building project “Slicer.vcxproj” – FAILED.

========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========