Error MSB8066 during building?

Hello all,

I have been trying to get SimpleITK set up with Elastix, following the instructions on the pages for Building SimpleITK and Building SimpleITK on Windows. I am using Visual Studio 18, Python 3.14, and CMake 4.2.0. I can get through most of the process until it comes to building in Visual Studio, where I get this error:

Configuring incomplete, errors occurred!
12>C:\Program Files\Microsoft Visual Studio\18\Community\MSBuild\Microsoft\VC\v180\Microsoft.CppCommon.targets(254,5): error MSB8066: Custom build for ‘D:\SimpleITK-build\CMakeFiles\1daa201e4876001beb2745ee8c537f6f\SimpleITKExamples-mkdir.rule;D:\SimpleITK-build\CMakeFiles\1daa201e4876001beb2745ee8c537f6f\SimpleITKExamples-download.rule;D:\SimpleITK-build\CMakeFiles\1daa201e4876001beb2745ee8c537f6f\SimpleITKExamples-update.rule;D:\SimpleITK-build\CMakeFiles\1daa201e4876001beb2745ee8c537f6f\SimpleITKExamples-patch.rule;D:\SimpleITK-build\CMakeFiles\1daa201e4876001beb2745ee8c537f6f\SimpleITKExamples-configure.rule;D:\SimpleITK-build\CMakeFiles\1daa201e4876001beb2745ee8c537f6f\SimpleITKExamples-build.rule;D:\SimpleITK-build\CMakeFiles\1daa201e4876001beb2745ee8c537f6f\SimpleITKExamples-install.rule;D:\SimpleITK-build\CMakeFiles\db78d2f8b7b721676568918a53364fe8\SimpleITKExamples-complete.rule;D:\SimpleITK-build\CMakeFiles\d0ae7294290e14b4b2f8e27aec435f49\SimpleITKExamples.rule;D:\SimpleITK\SuperBuild\CMakeLists.txt’ exited with code 1.
13>------ Skipped Build: Project: ALL_BUILD, Configuration: Debug x64 ------
13>Project not selected to build for this solution configuration
========== Build: 7 succeeded, 5 failed, 0 up-to-date, 1 skipped ==========
========== Build completed at 8:25 PM and took 26:56.281 minutes ==========

Unfortunately, I have not been able to figure out what is causing this and how to get past it. I would be extremely grateful for any insight or advice!

Thank you!

Rock

Hello Rock,

Unfortunately, the initial error is not included in your log here so this is challenging to give a solution.

You say you are using Visual Studio 18 2026. That compiler appears to have been released this month. I have not used it nor do I see it available on the Github hosted runners to easily test. @Niels_Dekker may be able to shed some light on compatibility with ITK 5.4.5 or if there are other know issues with the new compiler.

There are two components CMake uses with Visual studio the generator, and the toolset. It needs to be determined if the error is with the VS18 generator, cmake code or a compiler error specific to this new version.

If it’s a compilation error, then an older toolset could be used by setting CMAKE_GENERATOR_TOOLSET to something like “v143,host=x64”.

Thank you for using and testing the latest tools with SimpleITK. If you could share a complete build log, or at least a larger one with the primary error it could help with further assistance.

Brad

1 Like