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

2 Likes

ITK main builds fine with CMake 4.2.0 and VS2026.

1 Like

ITK 5.4.5 also builds fine with Visual Studio 2026 (I forgot to write this earlier).

2 Likes

Hello Brad,

So sorry for my slow reply; I had not seen that people had responded! I really appreciate the help. I have attached the complete build log here:

SimpleITK build log.txt (660.2 KB)

I have tried a few more times to build but keep running into the same 7 succeeded, 5 failed message. I followed the instructions for building from Building SimpleITK — SimpleITK 2.4.0 documentation and Building SimpleITK on Windows — SimpleITK 2.4.0 documentation with the only difference being that I added “-DSimpleITK_USE_ELASTIX=ON” as a Cmake option.

I do not have much experience with building programs so I am not sure what information would be useful to include but will be happy to send more if you let me know.

Thank you!

Rock

Hello,

Please try checking out the git tag “v2.5.3” and building the latest stable release.

The build log appears to be building the unstable development branch of SimpleITK. The current development is towards a major version change towards a SimpleITK 3.0 release. Here are some important messages from the build:

Building SimpleITK version "3.0.0a1.post110-gc7827"
4>  Building Custom Rule D:/SimpleITK/SuperBuild/CMakeLists.txt
3>  no such file or directory
3>C:\Program Files\Microsoft Visual Studio\18\Community\MSBuild\Microsoft\VC\v180\Microsoft.CppCommon.targets(254,5): error MSB8066: Custom build for 'D:\SimpleITK\SuperBuild\ExternalSource\uv_install.sh.sha512;D:\SimpleITK-build\CMakeFiles\2c092dc618b2ece4a25a57ff4bcffb9b\uv.exe.rule;D:\SimpleITK-build\CMakeFiles\7d4556eec2e21401177be744b430b57d\python.exe.rule;D:\SimpleITK-build\CMakeFiles\d0ae7294290e14b4b2f8e27aec435f49\SimpleITK_VENV.rule;D:\SimpleITK\SuperBuild\CMakeLists.txt' exited with code 1.

8>  -- Found the following C# .NET versions: v4.0.30319
8>  CMake Error at CMake/sitkGenerateFilterSource.cmake:23 (message):
8>    SimpleITK_Python_EXECUTABLE is set to an invalid executable:
8>    D:/SimpleITK-build/venv/Scripts/python.exe

I’ll look into them these error on the development (“main”) branch to see if a fix is needed. Please try building the stable release tag and report back if there are any issues.

3 Likes

Hello Brad,

Thank you for your advice! I used the source code for version 2.5.3 and this time got 11 successes, 0 failures. In case it would be useful, I have attached the build log for the successful build.

SimpleITK2.5.3-build log.txt (1.8 MB)

If I can provide any information that would be helpful to look into the errors let me know. Thank you very much again for your help!

Rock

3 Likes

Hello,

I believe the source of your build error on the main branch was that there was no sh shell available to run the uv install script. A fix which adds a powershell installer for uv has been added to the development branch: Add uv installer for powershell by blowekamp · Pull Request #2487 · SimpleITK/SimpleITK · GitHub

Thank you for reporting the build issue. You have helped the community :slight_smile:

3 Likes