VTK/VTK 6 Migration/Factories now require defines: Difference between revisions

From KitwarePublic
< VTK
Jump to navigationJump to search
(Created page with "If you build your project with CMake, and you use the standard find_package(VTK) and include(${VTK_USE_FILE}) then this problem should not occur. (Because the defines will be aut...")
 
No edit summary
Line 10: Line 10:
See these references (and follow the mailing list threads to their conclusions) for more info:
See these references (and follow the mailing list threads to their conclusions) for more info:


* [http://www.vtk.org/pipermail/vtkusers/2013-April/128255.html]
* [http://www.vtk.org/pipermail/vtkusers/2013-April/128255.html http://www.vtk.org/pipermail/vtkusers/2013-April/128255.html]
* [https://github.com/Kitware/VTK/commit/9385718b82e6af83b7e7dcc90a937419edc6892b]
* [https://github.com/Kitware/VTK/commit/9385718b82e6af83b7e7dcc90a937419edc6892b https://github.com/Kitware/VTK/commit/9385718b82e6af83b7e7dcc90a937419edc6892b]
* [http://www.vtk.org/pipermail/vtkusers/2013-March/127811.html]
* [http://www.vtk.org/pipermail/vtkusers/2013-March/127811.html http://www.vtk.org/pipermail/vtkusers/2013-March/127811.html]

Revision as of 10:11, 3 May 2013

If you build your project with CMake, and you use the standard find_package(VTK) and include(${VTK_USE_FILE}) then this problem should not occur. (Because the defines will be automatically added for you by virtue of the include(${VTK_USE_FILE})...)

The factory methods now require "auto-initialization" depending on what modules are enabled at VTK configure time. If you are enabling all modules, and building your project without using CMake, you will need some defines in your project in order to make the factories work properly.

Try including this snippet in all your code that includes VTK usage:

 #define vtkRenderingCore_AUTOINIT 4(vtkInteractionStyle,vtkRenderingFreeType,vtkRenderingFreeTypeOpenGL,vtkRenderingOpenGL)
 #define vtkRenderingVolume_AUTOINIT 1(vtkRenderingVolumeOpenGL)

See these references (and follow the mailing list threads to their conclusions) for more info: