Vtk 9.3.0 Compile Errors with Visual Studio 2022 (Debug)

I am trying to compile VTK 9.3.0 using VS 2022 (64 bit binaries) and I get the following errors:

FAILED: bin/Debug/vtkFiltersReduction-9.3d.dll lib/Debug/vtkFiltersReduction-9.3d.lib
cmd.exe /C "cd . && E:\AzureDevOps\cmake-3.26.3-windows-x86_64\bin\cmake.exe -E vs_link_dll --intdir=Filters\Reduction\CMakeFiles\FiltersReduction.dir\Debug --rc=C:\PROGRA~2\WI3CF2~1\10\bin\100220~1.0\x64\rc.exe --mt=C:\PROGRA~2\WI3CF2~1\10\bin\100220~1.0\x64\mt.exe --manifests  -- C:\PROGRA~1\MICROS~4\2022\COMMUN~1\VC\Tools\MSVC\1438~1.331\bin\Hostx64\x64\link.exe /nologo Filters\Reduction\CMakeFiles\FiltersReduction.dir\Debug\vtkToAffineArrayStrategy.cxx.obj Filters\Reduction\CMakeFiles\FiltersReduction.dir\Debug\vtkToConstantArrayStrategy.cxx.obj Filters\Reduction\CMakeFiles\FiltersReduction.dir\Debug\vtkToImplicitArrayFilter.cxx.obj Filters\Reduction\CMakeFiles\FiltersReduction.dir\Debug\vtkToImplicitRamerDouglasPeuckerStrategy.cxx.obj Filters\Reduction\CMakeFiles\FiltersReduction.dir\Debug\vtkToImplicitStrategy.cxx.obj Filters\Reduction\CMakeFiles\FiltersReduction.dir\Debug\vtkToImplicitTypeErasureStrategy.cxx.obj  /out:bin\Debug\vtkFiltersReduction-9.3d.dll /implib:lib\Debug\vtkFiltersReduction-9.3d.lib /pdb:bin\Debug\vtkFiltersReduction-9.3d.pdb /dll /version:9.3 /machine:x64  /debug /INCREMENTAL  lib\Debug\vtkCommonExecutionModel-9.3d.lib  lib\Debug\vtkCommonDataModel-9.3d.lib  lib\Debug\vtkCommonTransforms-9.3d.lib  lib\Debug\vtkCommonMath-9.3d.lib  lib\Debug\vtkkissfft-9.3d.lib  lib\Debug\vtkCommonCore-9.3d.lib  lib\Debug\vtksys-9.3d.lib  ws2_32.lib  dbghelp.lib  psapi.lib  kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib  && cd ."
LINK Pass 1: command "C:\PROGRA~1\MICROS~4\2022\COMMUN~1\VC\Tools\MSVC\1438~1.331\bin\Hostx64\x64\link.exe /nologo Filters\Reduction\CMakeFiles\FiltersReduction.dir\Debug\vtkToAffineArrayStrategy.cxx.obj Filters\Reduction\CMakeFiles\FiltersReduction.dir\Debug\vtkToConstantArrayStrategy.cxx.obj Filters\Reduction\CMakeFiles\FiltersReduction.dir\Debug\vtkToImplicitArrayFilter.cxx.obj Filters\Reduction\CMakeFiles\FiltersReduction.dir\Debug\vtkToImplicitRamerDouglasPeuckerStrategy.cxx.obj Filters\Reduction\CMakeFiles\FiltersReduction.dir\Debug\vtkToImplicitStrategy.cxx.obj Filters\Reduction\CMakeFiles\FiltersReduction.dir\Debug\vtkToImplicitTypeErasureStrategy.cxx.obj /out:bin\Debug\vtkFiltersReduction-9.3d.dll /implib:lib\Debug\vtkFiltersReduction-9.3d.lib /pdb:bin\Debug\vtkFiltersReduction-9.3d.pdb /dll /version:9.3 /machine:x64 /debug /INCREMENTAL lib\Debug\vtkCommonExecutionModel-9.3d.lib lib\Debug\vtkCommonDataModel-9.3d.lib lib\Debug\vtkCommonTransforms-9.3d.lib lib\Debug\vtkCommonMath-9.3d.lib lib\Debug\vtkkissfft-9.3d.lib lib\Debug\vtkCommonCore-9.3d.lib lib\Debug\vtksys-9.3d.lib ws2_32.lib dbghelp.lib psapi.lib kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib /MANIFEST /MANIFESTFILE:Filters\Reduction\CMakeFiles\FiltersReduction.dir\Debug/intermediate.manifest Filters\Reduction\CMakeFiles\FiltersReduction.dir\Debug/manifest.res" failed (exit code 1169) with the following output:
vtkCommonCore-9.3d.lib(vtkCommonCore-9.3d.dll) : error LNK2005: "public: __cdecl vtkConstantImplicitBackend<float>::vtkConstantImplicitBackend<float>(float)" (??0?$vtkConstantImplicitBackend@M@@QEAA@M@Z) already defined in vtkToImplicitRamerDouglasPeuckerStrategy.cxx.obj
vtkCommonCore-9.3d.lib(vtkCommonCore-9.3d.dll) : error LNK2005: "public: __cdecl vtkConstantImplicitBackend<double>::vtkConstantImplicitBackend<double>(double)" (??0?$vtkConstantImplicitBackend@N@@QEAA@N@Z) already defined in vtkToImplicitRamerDouglasPeuckerStrategy.cxx.obj
vtkCommonCore-9.3d.lib(vtkCommonCore-9.3d.dll) : error LNK2005: "public: __cdecl vtkConstantImplicitBackend<char>::vtkConstantImplicitBackend<char>(char)" (??0?$vtkConstantImplicitBackend@D@@QEAA@D@Z) already defined in vtkToImplicitRamerDouglasPeuckerStrategy.cxx.objvtkCommonCore-9.3d.lib(vtkCommonCore-9.3d.dll) : error LNK2005: "public: __cdecl vtkConstantImplicitBackend<signed char>::vtkConstantImplicitBackend<signed char>(signed char)" (??0?$vtkConstantImplicitBackend@C@@QEAA@C@Z) already defined in vtkToImplicitRamerDouglasPeuckerStrategy.cxx.obj
vtkCommonCore-9.3d.lib(vtkCommonCore-9.3d.dll) : error LNK2005: "public: __cdecl vtkConstantImplicitBackend<unsigned char>::vtkConstantImplicitBackend<unsigned char>(unsigned char)" (??0?$vtkConstantImplicitBackend@E@@QEAA@E@Z) already defined in vtkToImplicitRamerDouglasPeuckerStrategy.cxx.obj
vtkCommonCore-9.3d.lib(vtkCommonCore-9.3d.dll) : error LNK2005: "public: __cdecl vtkConstantImplicitBackend<short>::vtkConstantImplicitBackend<short>(short)" (??0?$vtkConstantImplicitBackend@F@@QEAA@F@Z) already defined in vtkToImplicitRamerDouglasPeuckerStrategy.cxx.obj
vtkCommonCore-9.3d.lib(vtkCommonCore-9.3d.dll) : error LNK2005: "public: __cdecl vtkConstantImplicitBackend<unsigned short>::vtkConstantImplicitBackend<unsigned short>(unsigned short)" (??0?$vtkConstantImplicitBackend@G@@QEAA@G@Z) already defined in vtkToImplicitRamerDouglasPeuckerStrategy.cxx.obj
vtkCommonCore-9.3d.lib(vtkCommonCore-9.3d.dll) : error LNK2005: "public: __cdecl vtkConstantImplicitBackend<int>::vtkConstantImplicitBackend<int>(int)" (??0?$vtkConstantImplicitBackend@H@@QEAA@H@Z) already defined in vtkToImplicitRamerDouglasPeuckerStrategy.cxx.obj
vtkCommonCore-9.3d.lib(vtkCommonCore-9.3d.dll) : error LNK2005: "public: __cdecl vtkConstantImplicitBackend<unsigned int>::vtkConstantImplicitBackend<unsigned int>(unsigned int)" (??0?$vtkConstantImplicitBackend@I@@QEAA@I@Z) already defined in vtkToImplicitRamerDouglasPeuckerStrategy.cxx.obj
vtkCommonCore-9.3d.lib(vtkCommonCore-9.3d.dll) : error LNK2005: "public: __cdecl vtkConstantImplicitBackend<long>::vtkConstantImplicitBackend<long>(long)" (??0?$vtkConstantImplicitBackend@J@@QEAA@J@Z) already defined in vtkToImplicitRamerDouglasPeuckerStrategy.cxx.objvtkCommonCore-9.3d.lib(vtkCommonCore-9.3d.dll) : error LNK2005: "public: __cdecl vtkConstantImplicitBackend<unsigned long>::vtkConstantImplicitBackend<unsigned long>(unsigned long)" (??0?$vtkConstantImplicitBackend@K@@QEAA@K@Z) already defined in vtkToImplicitRamerDouglasPeuckerStrategy.cxx.obj
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.cxx.obj
vtkCommonCore-9.3d.lib(vtkCommonCore-9.3d.dll) : error LNK2005: "public: __cdecl vtkConstantImplicitBackend<unsigned __int64>::vtkConstantImplicitBackend<unsigned __int64>(unsigned __int64)" (??0?$vtkConstantImplicitBackend@_K@@QEAA@_K@Z) already defined in vtkToImplicitRamerDouglasPeuckerStrategy.cxx.obj
   Creating library lib\Debug\vtkFiltersReduction-9.3d.lib and object lib\Debug\vtkFiltersReduction-9.3d.exp
bin\Debug\vtkFiltersReduction-9.3d.dll : fatal error LNK1169: one or more multiply defined symbols found
[3503/3535] Generating proj.db
ninja: build stopped: subcommand failed.

I have reproduced this on 2 different Windows 10 machines, both using VS 17 2022 v143 toolkit. Compiled just fine on macOS and Linux.

Has anyone else seen this?

Thanks
Mike Jackson

Already fixed but not in the 9.3.0 sadly

https://gitlab.kitware.com/vtk/vtk/-/issues/19166

It should be in 9.3.1 (when that happens).

2 Likes

Is there any time frame on the 9.3.1 release?

Nothing firm; probably after ParaView 5.12 in case it finds bugs that should be backported too.

you can try deleting or uninstalling vtkFiltersReduction project and rebuilding ALL_BUILD,but I do not know why

Maybe it should be considered to just remove the 9.3.0 tag then? From my perspective as a user of VTK libraries, when a release is posted my implicit assumption is that the release will work on the major platforms (Linux/macOS/Windows) using compilers that are released in the last few years.

We can obviously continue to use the 9.2.6 release to make our own Application release but there were the usual fixes/performance improvements/new features that we wanted to incorporate into our own application and we started basing our schedule on the fact that the 9.3.0 release was out. We are now having to reschedule our engineers onto other features until a workable release is posted. We work from official releases from VTK so that when we compile on the various platforms and then with python we have known versions to use and match up between the systems.

1 Like

We do test with VS2022 regularly, just not in Debug builds (or Visual Studio). Adding regular Debug builds is on my list to add once I get the chance; VS will probably end up being weekly builds because Windows CI machine time is precious and VS is…not fast. I’ll try to send a flare to hopefully allow it to move up my priority list…

Hey Ben,
Thank you for the reply and explanation. I am very well aware of just how slow visual studio debug builds are and how that can jam up a build bot where build times are precious. I would like to very respectfully counter with: My time is also precious to me. And wasting 4 hours going down a rabbit hole wasn’t really on my list of things to do. And it wasn’t really supposed to be on my priority list either but here we are. I am curious how many other developer’s time has been wasted trying to spin up a VTK 9.3.0 build only to discover after the excruciatingly long build that they can’t actually use the build and have to pivot to another branch, commit, tag or go back to what they were using.

Again, I would urge Kitware to just pull the 9.3.0 tag with an apology and explanation OR just put out the 9.3.0.patch1 release that actually works and stop wasting developers time. Our time is also precious.

1 Like

Sorry it took so long; here’s a branch which seems to work for me: https://gitlab.kitware.com/vtk/vtk/-/merge_requests/10787

I agree with @Michael_Jackson

Sadly 4 months later there is still no patch release or tag which fixes the 9.3.0 VS debug builds.