[MSVC] VTK failed to build due to error LNK2019 and error LNK1120
Hi all: recently we update the commit of VTK for MSVC RWC testing, but it failed to build due to error LNK2019 and error LNK1120. Could you please take a look? Thanks.
Repro steps:
- git clone https://gitlab.kitware.com/vtk/vtk F:\gitP\vtk\vtk
- git -C "F:\gitP\vtk\vtk" reset --hard d731e5ec
- git -C "F:\gitP\vtk\vtk" submodule sync
- git -C "F:\gitP\vtk\vtk" submodule update --init --recursive
- set VSCMD_SKIP_SENDTELEMETRY=1 & "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\VsDevCmd.bat" -host_arch=amd64 -arch=amd64
- mkdir F:\gitP\vtk\vtk\build_amd64 and cd F:\gitP\vtk\vtk\build_amd64
- cmake -G "Visual Studio 17 2022" -A x64 -DCMAKE_SYSTEM_VERSION=10.0.22621.0 -DBUILD_SHARED_LIBS=OFF -DVTK_BUILD_TESTING=WANT -DVTK_BUILD_EXAMPLES=OFF -DVTK_IGNORE_CMAKE_CXX11_CHECKS=TRUE -DVTK_DATA_EXCLUDE_FROM_ALL=ON ..
- msbuild /m /p:Platform=x64 /p:Configuration=Release All_BUILD.vcxproj /t:Rebuild
Expected: Build successfully.
Actual:
"F:\gitP\vtk\vtk\build_amd64\All_BUILD.vcxproj" (Rebuild target) (1) ->
"F:\gitP\vtk\vtk\build_amd64\Interaction\Widgets\Testing\Cxx\vtkInteractionWidgetsCxxTests.vcxproj" (default target) (360:2) ->
vtkCommonCore-9.2.lib(vtkSMPToolsAPI.obj) : 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) [F:\gitP\vtk\vtk\build_amd64\Interaction\Widgets\Testing\Cxx\vtkInteractionWidgetsCxxTests.vcxproj]
F:\gitP\vtk\vtk\build_amd64\bin\Release\vtkInteractionWidgetsCxxTests.exe : fatal error LNK1120: 1 unresolved externals [F:\gitP\vtk\vtk\build_amd64\Interaction\Widgets\Testing\Cxx\vtkInteractionWidgetsCxxTests.vcxproj]
More: OS: Windows server 2022 21H2 Visual Studio: VS2022 17.5.5