I am running an example in VTK and it is giving the following error:
vtkImageSliceMapper.cxx:36 WARN| Error: no override found for ‘vtkImageSliceMapper’.
1st I compiled in Windows the VTK
2nd I included the directory of the include files
3rd I copied all the dll to the program directory. Also include in compilation all the .lib.
The example is https://vtk.org/Wiki/VTK/Examples/Cxx/IO/MetaImageReader
This error means that vtkOpenGLImageSliceMapper is missing. If you link the vtkRenderingOpenGL2 library into your app, the error should go away. The vtkOpenGLImageSliceMapper class is the “implementation” of the vtkImageSliceMapper class, i.e. when you call vtkImageSliceMapper::New(), a vtkOpenGLImageSliceMapper is actually created.
This new error that you are reporting is completely different from the first error you reported. Fortunately, it has an easy fix. Use GetOutputPort() instead of GetOutput():
Ok, I made some changes and I made an error. Now I corrected and returned the former error. The former error is a runtime error.
Visual 2017
The library(vtkRenderingOpenGL2 and all others of VTK) is in Properties->Linker->Input->Additional Dependencies
*.dll(s) copied to x64\Release
Properties->VC++ Directories->Library Directories = C:\Program Files (x86)\VTK\lib
Properties->VC++ Directories->Include Directories = C:\Program Files (x86)\VTK\include\vtk-9.0
Properties->Linker->General->Additional Library Directories->C:\Program Files (x86)\VTK\lib
Aha, you aren’t using cmake. With cmake, the VTK overrides are handled automatically. But since you are doing everything in Visual Studio, you will have to add some extra steps to make it work.
Unfortunately, I forget the details, but if you search for “VTK AUTOINIT” something might come up.
First, I generated the projects (Visual 2017, x64, Release) with cmake-gui. Then I loaded the “INSTALL” project in Visual. And build ALL-BUILD. And then build INSTALL.
The factory overrides are mostly automated if you configure your project with a CMakeLists.txt, as I’ve mentioned before in this thread. If you do the configuration within visual studio, you have to do extra steps. Again, I’m just repeating what I’ve said before.
Hello,
I also got the same error: Error: no override found for ‘vtkRayCastImageDisplayHelper’. Although I have added this library to the project configuration:C:\Program Files\VTK\lib\vtkRenderingVolumeOpenGL2-9.3.lib.
Thanks for any help.
PonPat