Link Error vtkCommonDataModel-9.1d.lib(vtkDataAssembly.obj) : error LNK2019: unresolved external symbol "public: __cdecl vtkpugixml::xml_attribute::operator ...
Issue occurred when updating from 9.0.3 to 9.1.0 on Windows 10 21H2 Professional with Visual Studio 2019 16.11.6 Professional. I am using only the following subset of the VTK libraries in my application compiled as static libs (Debug/Release):
vtkCommonCore-9.0(d).lib
vtkCommonDataModel-9.0(d).lib
vtkCommonExecutionModel-9.0(d).lib
vtkCommonMath-9.0(d).lib
vtkCommonMisc-9.0(d).lib
vtkCommonSystem-9.0(d).lib
vtkCommonTransforms-9.0(d).lib
vtkImagingHybrid-9.0(d).lib
vtkInfovisLayout-9.0(d).lib
vtksys-9.0(d).lib
Now when I link the new 9.1.0 libraries to my application I get various link errors:
1>vtkCommonDataModel-9.1d.lib(vtkDataAssembly.obj) : error LNK2019: unresolved external symbol "public: __cdecl vtkpugixml::xml_attribute::operator void (__cdecl*)(class vtkpugixml::xml_attribute * * *)(void)const " (??Bxml_attribute@vtkpugixml@@QEBAP6AXPEAPEAPEAV01@@ZXZ) referenced in function "public: bool __cdecl vtkDataAssembly::HasAttribute(int,char const *)const " (?HasAttribute@vtkDataAssembly@@QEBA_NHPEBD@Z)
1>vtkCommonDataModel-9.1d.lib(vtkDataAssembly.obj) : error LNK2019: unresolved external symbol "public: bool __cdecl vtkpugixml::xml_attribute::operator!(void)const " (??7xml_attribute@vtkpugixml@@QEBA_NXZ) referenced in function "public: void __cdecl vtkDataAssembly::SetAttribute(int,char const *,char const *)" (?SetAttribute@vtkDataAssembly@@QEAAXHPEBD0@Z)
1>vtkCommonDataModel-9.1d.lib(vtkDataAssembly.obj) : error LNK2019: unresolved external symbol "public: char const * __cdecl vtkpugixml::xml_attribute::value(void)const " (?value@xml_attribute@vtkpugixml@@QEBAPEBDXZ) referenced in function "public: virtual bool __cdecl `anonymous namespace'::ValidationAndInitializationWalker::for_each(class vtkpugixml::xml_node &)" (?for_each@ValidationAndInitializationWalker@?A0x93ac3df4@@UEAA_NAEAVxml_node@vtkpugixml@@@Z)
...
It seems that I must also link vtkpugixml-9.1(d).lib now, but in VTK\Common\DataModel\vtk.module VTK::pugixml is listed as PRIVATE_DEPENDS.
How can I use the vtkCommonDataModel without explicitly linking my application to vtkpugixml? Thanks for the help, Andreas.