# vtk 9.6.2 build error

**URL:** https://discourse.vtk.org/t/vtk-9-6-2-build-error/16461
**Category:** Support
**Created:** [June 17, 2026, 12:07am UTC](https://discourse.vtk.org/t/vtk-9-6-2-build-error/16461 "2026-06-17T00:07:52Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![APlenkin](https://discourse.vtk.org/user_avatar/discourse.vtk.org/aplenkin/32/10672_2.png) [@APlenkin](https://discourse.vtk.org/u/APlenkin)
#### Post date: [June 17, 2026, 12:07am UTC](https://discourse.vtk.org/t/vtk-9-6-2-build-error/16461/1 "2026-06-17T00:07:52Z")

</div>

Hello,

I am trying to upgrade from 9.5.2 to 9.6.2. But I got few errors durin build.

C:\Users\golde\Desktop\VTK-9.6.2\ThirdParty\scn\vtkscn\src\vtkscn\impl.h(713): error C2131: expression did not evaluate to a constant  
C:\Users\golde\Desktop\VTK-9.6.2\ThirdParty\scn\vtkscn\src\vtkscn/impl.h(713): note: a non-constant (sub-)expression was encountered  
C:\Users\golde\Desktop\VTK-9.6.2\ThirdParty\scn\vtkscn\src\vtkscn/impl.h(2277): note: see reference to variable template ‘const bool vtkscn::v4::impl::function\_ref\<`template-type-parameter-1’,$RBAAC \*cdecl($TBAAD)\>::is\_invocable\_using\<\<lambda\_1fa5303999cf1e0c071930c19e38b357\> &\>’ being compiled  
C:\Users\golde\Desktop\VTK-9.6.2\ThirdParty\scn\vtkscn\src\vtkscn/impl.h(3064): note: see reference to function template instantiation ‘vtkscn::v4::detail::basic\_scan\_buffer::forward\_iterator vtkscn::v4::impl::read\_while\_classic\_space(Range)’ being compiled  
with

SourceRange=vtkscn::v4::ranges::detail::subrange\*::subrange\<vtkscn::v4::detail::basic\_scan\_buffer::forward\_iterator,vtkscn::v4::ranges::default\_sentinel\_t\>, Range=vtkscn::v4::ranges::detail::subrange::subrange\<vtkscn::v4::detail::basic\_scan\_buffer::forward\_iterator,vtkscn::v4::ranges::default\_sentinel\_t\>

C:\Users\golde\Desktop\VTK-9.6.2\ThirdParty\scn\vtkscn\src\vtkscn\impl.cpp(250): note: see reference to function template instantiation ‘vtkscn::v4::impl::eof\_expectedvtkscn::v4::detail::basic\_scan\_buffer::forward\_iterator vtkscn::v4::impl::skip\_classic\_whitespace(const SourceRange &,bool)’ being compiled  
with

Range=vtkscn::v4::ranges::detail::subrange\_::subrange\<vtkscn::v4::detail::basic\_scan\_buffer::forward\_iterator,vtkscn::v4::ranges::default\_sentinel\_t\>, SourceRange=vtkscn::v4::ranges::detail::subrange\_::subrange\<vtkscn::v4::detail::basic\_scan\_buffer::forward\_iterator,vtkscn::v4::ranges::default\_sentinel\_t\>

C:\Users\golde\Desktop\VTK-9.6.2\ThirdParty\scn\vtkscn\src\vtkscn\impl.cpp(282): note: see reference to function template instantiation ‘vtkscn::v4::scan\_expected\<vtkscn::v4::basic\_scan\_contextvtkscn::v4::detail::buffer\_range\_tag,char::iterator\> vtkscn::v4::detail::internal\_skip\_classic\_whitespace\<vtkscn::v4::ranges::detail::subrange\_::subrangevtkscn::v4::detail::basic\_scan\_buffer::forward\_iterator,vtkscn::v4::ranges::default\_sentinel\_t\>(Range,bool)’ being compiled  
with

Range=vtkscn::v4::ranges::detail::subrange\_::subrange\<vtkscn::v4::detail::basic\_scan\_buffer::forward\_iterator,vtkscn::v4::ranges::default\_sentinel\_t\>

C:\Users\golde\Desktop\VTK-9.6.2\ThirdParty\scn\vtkscn\src\vtkscn\impl.h(2274): error C2664: ‘vtkscn::v4::detail::basic\_scan\_buffer::forward\_iterator vtkscn::v4::impl::read\_while\_code\_point(Range,vtkscn::v4::impl::function\_ref\<bool (char32\_t),bool (char32\_t)\>)’: cannot convert argument 2 from ‘vtkscn::v4::impl::read\_while\_classic\_space::\<lambda\_1fa5303999cf1e0c071930c19e38b357\>’ to ‘vtkscn::v4::impl::function\_ref\<bool (char32\_t),bool (char32\_t)\>’  
with

Range=vtkscn::v4::ranges::detail::subrange\_::subrange\<vtkscn::v4::detail::basic\_scan\_buffer::forward\_iterator,vtkscn::v4::ranges::default\_sentinel\_t\>

C:\Users\golde\Desktop\VTK-9.6.2\ThirdParty\scn\vtkscn\src\vtkscn/impl.h(2277): note: No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called  
C:\Users\golde\Desktop\VTK-9.6.2\ThirdParty\scn\vtkscn\src\vtkscn\impl.h(2274): error C2664: ‘vtkscn::v4::detail::basic\_scan\_buffer\<wchar\_t\>::forward\_iterator vtkscn::v4::impl::read\_while\_code\_point(Range,vtkscn::v4::impl::function\_ref\<bool (char32\_t),bool (char32\_t)\>)’: cannot convert argument 2 from ‘vtkscn::v4::impl::read\_while\_classic\_space::\<lambda\_1e291a83f290e3ec2c2f78ef5d8a6d36\>’ to ‘vtkscn::v4::impl::function\_ref\<bool (char32\_t),bool (char32\_t)\>’  
with

Range=vtkscn::v4::ranges::detail::subrange\_::subrange\<vtkscn::v4::detail::basic\_scan\_buffer\<wchar\_t\>::forward\_iterator,vtkscn::v4::ranges::default\_sentinel\_t\>

For build I am using msvc 2022 with CMakeSettings.json

{  
“configurations”: [  
{  
“name”: “x64-Debug”,  
“generator”: “Visual Studio 17 2022 Win64”,  
“configurationType”: “Debug”,  
“buildRoot”: “{projectDir}\\out\\build\\{name}”,  
“installRoot”: “{projectDir}\\out\\install\\{name}”,  
“cmakeCommandArgs”: “-DCMAKE\_GENERATOR\_TOOLSET=v141”,  
“buildCommandArgs”: “”,  
“ctestCommandArgs”: “”,  
“inheritEnvironments”: [“msvc\_x64\_x64”],  
“variables”: [  
{  
“name”: “BUILD\_SHARED\_LIBS”,  
“value”: “False”,  
“type”: “BOOL”  
},  
{  
“name”: “VTK\_MODULE\_ENABLE\_VTK\_GUISupportQt”,  
“value”: “YES”,  
“type”: “STRING”  
},  
{  
“name”: “VTK\_MODULE\_ENABLE\_VTK\_ViewsQt”,  
“value”: “YES”,  
“type”: “STRING”  
}  
]  
},  
{  
“name”: “x64-Release”,  
“generator”: “Visual Studio 17 2022 Win64”,  
“configurationType”: “Release”,  
“buildRoot”: “{projectDir}\\out\\build\\{name}”,  
“installRoot”: “{projectDir}\\out\\install\\{name}”,  
“cmakeCommandArgs”: “-DCMAKE\_GENERATOR\_TOOLSET=v141”,  
“buildCommandArgs”: “”,  
“ctestCommandArgs”: “”,  
“inheritEnvironments”: [“msvc\_x64\_x64”],  
“variables”: [  
{  
“name”: “BUILD\_SHARED\_LIBS”,  
“value”: “False”,  
“type”: “BOOL”  
},  
{  
“name”: “VTK\_MODULE\_ENABLE\_VTK\_GUISupportQt”,  
“value”: “YES”,  
“type”: “STRING”  
},  
{  
“name”: “VTK\_MODULE\_ENABLE\_VTK\_ViewsQt”,  
“value”: “YES”,  
“type”: “STRING”  
}  
]  
}  
]  
}

It is the same as I build 9.5.2 but as I understand for 9.5.2 with this configuration vtkscn (there errors occure) does not build.

Please help me to fix error or probably reconfigure project.

Thank You,

Andrey

---

<div class="post-metadata">

### Author: ![jamesobutler](https://discourse.vtk.org/user_avatar/discourse.vtk.org/jamesobutler/32/7579_2.png) [@jamesobutler](https://discourse.vtk.org/u/jamesobutler)
#### Post date: [June 17, 2026, 12:59am UTC](https://discourse.vtk.org/t/vtk-9-6-2-build-error/16461/2 "2026-06-17T00:59:14Z")

</div>

The increase in minimum visual studio version for VTK 9.6 is detailed in the release notes. See the following:

> **[scnlib - 9.6 - VTK documentation](https://docs.vtk.org/en/latest/release_details/9.6.html#id2)**
>
> Compilers: Increase Minimum Microsoft Visual Studio Version to 2019 Due to the addition of the scnlib library and an update in the expat library, the minimum supported version of Microsoft Visual Studio (MSVC) for building VTK has been increased to...

---

<div class="post-metadata">

### Author: ![APlenkin](https://discourse.vtk.org/user_avatar/discourse.vtk.org/aplenkin/32/10672_2.png) [@APlenkin](https://discourse.vtk.org/u/APlenkin)
#### Post date: [June 17, 2026, 1:12am UTC](https://discourse.vtk.org/t/vtk-9-6-2-build-error/16461/3 "2026-06-17T01:12:30Z")

</div>

Thank You, so I will try “-DCMAKE\_GENERATOR\_TOOLSET=v142” or 143 and return with results

---

<div class="post-metadata">

### Author: ![APlenkin](https://discourse.vtk.org/user_avatar/discourse.vtk.org/aplenkin/32/10672_2.png) [@APlenkin](https://discourse.vtk.org/u/APlenkin)
#### Post date: [June 17, 2026, 1:03pm UTC](https://discourse.vtk.org/t/vtk-9-6-2-build-error/16461/4 "2026-06-17T13:03:10Z")

</div>

Build with -DCMAKE\_GENERATOR\_TOOLSET=v142 is fine. Thank You!
