vtkIOCoreModule header file missing, needed for vtkSTLReader

I am working to migrate an animated mesh visualization project from python to C++ (previously using pyvista), and I’ve run into a roadblock when attempting to use vtkSTLReader to access my mesh files.

My include statement is simply:

#include <vtkPolyData.h>
#include <vtkAbstractPolyDataReader.h>
#include <vtkSTLReader.h>

I am working with vtk 9.5.0 (installed a few days ago) and building with MSVC 2022, and I am met with the error

error C1083: Cannot open include file: 'vtkIOCoreModule.h': No such file or directory

Looking through the files in VTK/bin, this header file doesn’t appear to exist at all. I am open to using a different approach if there are better ways to work with STL files in VTK, but I’m not sure how to approach this problem. If vtkIOCoreModule.h is just something I can download and place into my IO directory, I would be open to trying that. Any suggestions?

Not sure how vtkSTLReader.h could be around without vtkIOCoreModule.h in an install tree. Did you install VTK or are you using it from its build tree? What does you CMake code to use VTK look like?

I downloaded VTK from the releases page and built using MSVC. The CylinderExample, ReadSTL, and KochSnowflake all work, but it seems like there’s some issue with how I’m referncing the IO folder. I’m building my file through MSVC as well, and my CMake code is pretty much just copied from ReadSTL since that file also does mesh IO. ReadSTL runs properly and somehow doesn’t fail to find IOCore, but my file can’t compile. I am fully open to the possibility that I’m just not configuring the compile correctly, but I don’t see why that would be the case if I’m pretty much just copying from a working file. Thanks!

Can you share your code?

I was able to fix the issue, although I’m not entirely sure what changed. Sorry for not being able to provide any more information here.