Documentation/Nightly/Developers/Tutorials/MigrationGuide/VTK8-to-VTK9
From Slicer Wiki
Revision as of 21:06, 18 May 2021 by JChris.FillionR (talk | contribs) (→Add missing std namespace identifier)
Home < Documentation < Nightly < Developers < Tutorials < MigrationGuide < VTK8-to-VTK9
Transition from VTK 8.0 to VTK 9.0
This section lists categories of code changes necessary to build Slicer with VTK 9.0. Each category has a short description, an example error message, a suggested upgrade path, and references to relevant commits.
Add missing std namespace identifier
To fix error messages similar to:
Replace code like this:
vtkIdType* cellPoints;
By this:
#if VTK_MAJOR_VERSION >= 9 || (VTK_MAJOR_VERSION >= 8 && VTK_MINOR_VERSION >= 90) const vtkIdType* cellPoints; #else vtkIdType* cellPoints; #endif
Add missing std namespace identifier
To fix error messages similar to:
/usr/include/c++/5/iosfwd:162:34: note: ‘std::ifstream’ /tmp/SPHARM-PDM/Modules/CLI/MetaMeshTools/MeshMath.cxx:4082:5: error: ‘ofstream’ was not declared in this scope ofstream output; ^
/usr/include/c++/5/iosfwd:162:34: note: ‘std::ifstream’ /tmp/SPHARM-PDM/Modules/CLI/MetaMeshTools/MeshMath.cxx:4117:5: error: ‘ofstream’ was not declared in this scope ofstream output; ^
Replace code like this:
ifstream input; ofstream output;
By this:
std::ifstream input; std::ofstream output;
References: