Skip to content

Fix unresolved external symbol __popcnt on win-arm64

Fixes link errors when building with Visual Studio 2022 on Windows for ARM64:

[ 50%] Linking CXX shared library ..\..\..\bin\vtkm_filter_vector_analysis-1.9.dll
LINK: command "C:\PROGRA~1\MICROS~1\2022\COMMUN~1\VC\Tools\MSVC\1434~1.319\bin\HOSTAR~1\arm64\link.exe /nologo @CMakeFiles\vtkm_filter_vector_analysis.dir\objects1.rsp /out:..\..\..\bin\vtkm_filter_vector_analysis-1.9.dll /implib:..\..\..\lib\vtkm_filter_vector_analysis-1.9.lib /pdb:C:\Build\_build\vtk-m-v1.9.0\_build-vc17-arm64\bin\vtkm_filter_vector_analysis-1.9.pdb /dll /version:1.0 /machine:ARM64 /INCREMENTAL:NO ..\..\..\lib\vtkm_filter_core-1.9.lib ..\..\..\lib\vtkm_worklet-1.9.lib ..\..\..\lib\vtkm_cont-1.9.lib ..\..\..\lib\vtkmdiympi_nompi.lib kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib /MANIFEST /MANIFESTFILE:..\..\..\bin\vtkm_filter_vector_analysis-1.9.dll.manifest" failed (exit code 1120) with the following output:
   Creating library ..\..\..\lib\vtkm_filter_vector_analysis-1.9.lib and object ..\..\..\lib\vtkm_filter_vector_analysis-1.9.exp
SurfaceNormals.cxx.obj : error LNK2019: unresolved external symbol __popcnt referenced in function "void __cdecl vtkm::exec::serial::internal::FunctorTiling1DExecute<struct vtkm::cont::internal::BitFieldToUnorderedSetFunctor<class vtkm::cont::detail::BitPortalBase<1>,class vtkm::internal::ArrayPortalBasicWrite<__int64> > >(void *,void * const,__int64,__int64)" (??$FunctorTiling1DExecute@U?$BitFieldToUnorderedSetFunctor@V?$BitPortalBase@$00@detail@cont@vtkm@@V?$ArrayPortalBasicWrite@_J@internal@4@@internal@cont@vtkm@@@internal@serial@exec@vtkm@@YAXPEAXQEAX_J2@Z)
..\..\..\bin\vtkm_filter_vector_analysis-1.9.dll : fatal error LNK1120: 1 unresolved externals
NMAKE : fatal error U1077: '"C:\Program Files\CMake\bin\cmake.exe"' : return code '0xffffffff'
Stop.

Merge request reports

Loading