LNK2019 unresolved external symbol... I encountered problems when building vtk into static libs

I encountered errors!
after generating VTK.sln in build tree with cmake, I compiled my build tree(built from VTK source) with VS2022, then the errors show:

Error LNK2019 unresolved external symbol “public: bool __cdecl vtk::detail::smp::vtkSMPToolsImpl<1>::IsParallelScope(void)” (?IsParallelScope@?$vtkSMPToolsImpl@$00@smp@detail@vtk@@QEAA_NXZ) referenced in function “public: bool __cdecl vtk::detail::smp::vtkSMPToolsAPI::IsParallelScope(void)” (?IsParallelScope@vtkSMPToolsAPI@smp@detail@vtk@@QEAA_NXZ) vtkProbeOpenGLVersion D:\VTK\build-9.3.1\Rendering\OpenGL2\vtkCommonCore-9.3.lib(vtkSMPToolsAPI.obj) 1
Error LNK1120 1 unresolved externals vtkProbeOpenGLVersion D:\VTK\build-9.3.1\bin\Release\vtkProbeOpenGLVersion-9.3.exe 1

more details:
in cmake, the generator is VS2022, and I unchecked the BUILD_SHARED_LIBS option in cmake-gui to obtain static libs.
in VS2022, I set the configurations to be “Release”,“x64”. the c++ standard is C++14.
the vtk version is 9.3.1.

this linker error is fixed in master branch - https://gitlab.kitware.com/vtk/vtk/-/merge_requests/11365. It will be available in 9.4 (november)

There’s also a follow-up fix for those same source files, but for a duplicate symbol rather than a missing symbol:
https://gitlab.kitware.com/vtk/vtk/-/merge_requests/11530/diffs
The follow-up fix is only required for people who use TBB.