Errors migrating VS Solution to VTK 9.1.0 (windows)

Hi all,
I downloaded and successfully built VTK 9.1.0 on Windows 10. Then I tried to update a working Win C++ Visual Studio 2019 .dll project which links to the older vtk 9.0.3.
I had a few compilation problems:

  1. “…Common\Core\vtkWin32Header.h(31,10): fatal error C1083: Cannot open include file: ‘vtkConfigure.h’: No such file or directory” Actually there is not anymore a file vtkConfigure.h in vtk 9.1.0 but I could find this (deprecated?) file: Common\Core\vtkConfigureDeprecated.h. I somewhat fixed this compile problem reusing the vtkConfigure.h from vtk 9.0.3 but I doubt that this is correct.
  2. After that, I faced another compile error: “…\IO\Image\vtkPNGWriter.h(29,10): fatal error C1083: Cannot open include file: ‘vtkIOImageModule.h’: No such file or directory” I had this problem also while compiling the vtk 9.0.3 and I solved it by copying the file vtkIOImageModule.h to an include directory.

I also get this new linking error for each obj in my project:
“error LNK2001: unresolved external symbol “protected: virtual void __cdecl vtkObjectBase::CollectRevisions(class std::basic_ostream<char,struct std::char_traits > &)” (?CollectRevisions@vtkObjectBase@@MEAAXAEAV?$basic_ostream@DU?$char_traits@D@std@@@std@@@Z)”
I don’t know how to fix this because my project already links to vtkCommonCore-9.1.lib from lib\Release which, in my understanding, should contains the vtkObjectBase class implementation.
Could someone shed some light on these errors? Thanks!

EDIT: I checked the vtkObjectBase.h header file and I can see the CollectRevisions declaration:

#ifndef VTK_LEGACY_REMOVE
  virtual void CollectRevisions(ostream&) {} // Legacy; do not use!
#endif

So perhaps should I build the vtk with the VTK_LEGACY_REMOVE define (in CMake?) in order to avoid the linker to look for the function definition? (I’ve built the vtk running CMake with the default settings to generate the VS Solution and then I built the solution which should be the correct way to build vtk from source on Windows)

vtkWin32Header.h now includes vtkBuild.h, not vtkConfigure.h even on 9.1.0. I suspect you have a stale vtkWin32Header.h being found somewhere.

This is odd. It should be installed just fine. Where did you find the vtkIOImageModule.h header that you copied elsewhere?

I don’t see a declaration of that method in 9.1.0…so I think you’re getting the wrong headers.

Hi Ben,
Thank you very much, you are right: my project was still including the old headers. I don’t know how it happened, I suspect I simply made the mistake of working too late when I am tired. Shame on me. This morning I built vtk 9.1.0 again and copied the headers and It worked fine. I got an error because my code was calling a deprecated function:
error C4996: ‘vtkThreshold::ThresholdBetween’: Use ‘SetLowerThreshold’, ‘SetUpperThreshold’ and ‘SetThresholdFunction’ instead.
I fixed it and because yesterday I did not get this error, this is another proof that I was compiling the wrong headers.
Sorry for the mistake and thanks again