Linker issue VTK 9.3.0 release
I tried to compile VTK using VS 2019 (debug) but get linker errors (configure and build logs are attached):
52>vtkCommonCore-9.3d.lib(vtkCommonCore-9.3d.dll) : error LNK2005: "public: __cdecl vtkConstantImplicitBackend::vtkConstantImplicitBackend(float)" (??0?$vtkConstantImplicitBackend@M@@QEAA@M@Z) already defined in vtkToImplicitRamerDouglasPeuckerStrategy.obj 52>vtkCommonCore-9.3d.lib(vtkCommonCore-9.3d.dll) : error LNK2005: "public: __cdecl vtkConstantImplicitBackend::vtkConstantImplicitBackend(double)" (??0?$vtkConstantImplicitBackend@N@@QEAA@N@Z) already defined in vtkToImplicitRamerDouglasPeuckerStrategy.obj 52>vtkCommonCore-9.3d.lib(vtkCommonCore-9.3d.dll) : error LNK2005: "public: __cdecl vtkConstantImplicitBackend::vtkConstantImplicitBackend(char)" (??0?$vtkConstantImplicitBackend@D@@QEAA@D@Z) already defined in vtkToImplicitRamerDouglasPeuckerStrategy.obj 52>vtkCommonCore-9.3d.lib(vtkCommonCore-9.3d.dll) : error LNK2005: "public: __cdecl vtkConstantImplicitBackend::vtkConstantImplicitBackend(signed char)" (??0?$vtkConstantImplicitBackend@C@@QEAA@C@Z) already defined in vtkToImplicitRamerDouglasPeuckerStrategy.obj 52>vtkCommonCore-9.3d.lib(vtkCommonCore-9.3d.dll) : error LNK2005: "public: __cdecl vtkConstantImplicitBackend::vtkConstantImplicitBackend(unsigned char)" (??0?$vtkConstantImplicitBackend@E@@QEAA@E@Z) already defined in vtkToImplicitRamerDouglasPeuckerStrategy.obj 52>vtkCommonCore-9.3d.lib(vtkCommonCore-9.3d.dll) : error LNK2005: "public: __cdecl vtkConstantImplicitBackend::vtkConstantImplicitBackend(short)" (??0?$vtkConstantImplicitBackend@F@@QEAA@F@Z) already defined in vtkToImplicitRamerDouglasPeuckerStrategy.obj 52>vtkCommonCore-9.3d.lib(vtkCommonCore-9.3d.dll) : error LNK2005: "public: __cdecl vtkConstantImplicitBackend::vtkConstantImplicitBackend(unsigned short)" (??0?$vtkConstantImplicitBackend@G@@QEAA@G@Z) already defined in vtkToImplicitRamerDouglasPeuckerStrategy.obj 52>vtkCommonCore-9.3d.lib(vtkCommonCore-9.3d.dll) : error LNK2005: "public: __cdecl vtkConstantImplicitBackend::vtkConstantImplicitBackend(int)" (??0?$vtkConstantImplicitBackend@H@@QEAA@H@Z) already defined in vtkToImplicitRamerDouglasPeuckerStrategy.obj 52>vtkCommonCore-9.3d.lib(vtkCommonCore-9.3d.dll) : error LNK2005: "public: __cdecl vtkConstantImplicitBackend::vtkConstantImplicitBackend(unsigned int)" (??0?$vtkConstantImplicitBackend@I@@QEAA@I@Z) already defined in vtkToImplicitRamerDouglasPeuckerStrategy.obj 52>vtkCommonCore-9.3d.lib(vtkCommonCore-9.3d.dll) : error LNK2005: "public: __cdecl vtkConstantImplicitBackend::vtkConstantImplicitBackend(long)" (??0?$vtkConstantImplicitBackend@J@@QEAA@J@Z) already defined in vtkToImplicitRamerDouglasPeuckerStrategy.obj 52>vtkCommonCore-9.3d.lib(vtkCommonCore-9.3d.dll) : error LNK2005: "public: __cdecl vtkConstantImplicitBackend::vtkConstantImplicitBackend(unsigned long)" (??0?$vtkConstantImplicitBackend@K@@QEAA@K@Z) already defined in vtkToImplicitRamerDouglasPeuckerStrategy.obj 52>vtkCommonCore-9.3d.lib(vtkCommonCore-9.3d.dll) : error LNK2005: "public: __cdecl vtkConstantImplicitBackend<__int64>::vtkConstantImplicitBackend<__int64>(__int64)" (??0?$vtkConstantImplicitBackend@_J@@QEAA@_J@Z) already defined in vtkToImplicitRamerDouglasPeuckerStrategy.obj 52>vtkCommonCore-9.3d.lib(vtkCommonCore-9.3d.dll) : error LNK2005: "public: __cdecl vtkConstantImplicitBackend::vtkConstantImplicitBackend(unsigned __int64)" (??0?$vtkConstantImplicitBackend@_K@@QEAA@_K@Z) already defined in vtkToImplicitRamerDouglasPeuckerStrategy.obj 52> Creating library F:/pack/VTK-9.3.0/build/lib/Debug/vtkFiltersReduction-9.3d.lib and object F:/pack/VTK-9.3.0/build/lib/Debug/vtkFiltersReduction-9.3d.exp 52>F:\pack\VTK-9.3.0\build\bin\Debug\vtkFiltersReduction-9.3d.dll : fatal error LNK1169: one or more multiply defined symbols found
I configure VTK like this:
set CONFIGURATION=Debug
set ROOT_DIR=%cd%
set VTK_SRC_DIR=%ROOT_DIR%\src
set WORKING_DIR=%ROOT_DIR%\build
set INSTALL_PREFIX_DIR=%ROOT_DIR%\install
mkdir %WORKING_DIR%
cd %WORKING_DIR%
set TBB_CMAKE_DIR=C:/Users/lloyd/Downloads/oneapi-tbb-2021.10.0-win/lib/cmake/tbb
rem Configure and generate VS project
cmake -G "Visual Studio 16 2019" -DCMAKE_INSTALL_PREFIX=%INSTALL_PREFIX_DIR%/%CONFIGURATION% ^
-DBUILD_TESTING:BOOL=OFF -DBUILD_SHARED_LIBS:BOOL=ON ^
-DVTK_GROUP_ENABLE_Imaging=WANT ^
-DVTK_GROUP_ENABLE_MPI=NO ^
-DVTK_GROUP_ENABLE_Qt=NO ^
-DVTK_GROUP_ENABLE_Rendering=DEFAULT ^
-DVTK_GROUP_ENABLE_StandAlone=WANT ^
-DVTK_GROUP_ENABLE_Views=NO ^
-DVTK_GROUP_ENABLE_Web=NO ^
-DVTK_MODULE_ENABLE_VTK_FiltersHybrid=YES ^
-DVTK_MODULE_ENABLE_VTK_FiltersVerdict=YES ^
-DVTK_MODULE_ENABLE_VTK_IOGeometry=YES ^
-DVTK_MODULE_ENABLE_VTK_IOParallel=YES ^
-DVTK_MODULE_ENABLE_VTK_IOParallelExodus=YES ^
-DVTK_MODULE_ENABLE_VTK_IOPLY=YES ^
-DVTK_WRAP_PYTHON:BOOL=OFF ^
-DVTK_ENABLE_WRAPPING:BOOL=OFF ^
-DVTK_INSTALL_PYTHON_EXES:BOOL=OFF ^
-DVTK_SMP_ENABLE_TBB:BOOL=ON ^
-DVTK_SMP_IMPLEMENTATION_TYPE:STRING=TBB ^
-DTBB_DIR=%TBB_CMAKE_DIR% ^
%VTK_SRC_DIR% > ..\"_ConfigureVTK%CONFIGURATION%.log"