vtk 9.6.2 build error

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

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

Thank You, so I will try “-DCMAKE_GENERATOR_TOOLSET=v142” or 143 and return with results