Difference between revisions of "Documentation/Nightly/Developers/Tutorials/MigrationGuide/VTK8-to-VTK9"

From Slicer Wiki
Jump to: navigation, search
(Created page with "==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 exampl...")
Tag: 2017 source edit
 
Tag: 2017 source edit
Line 1: Line 1:
 
==Transition from VTK 8.0 to VTK 9.0 ==
 
==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.
 
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:: ===
 +
 +
<b>To fix warning message similar to:</b>
 +
 +
<pre>
 +
/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;
 +
    ^
 +
</pre>
 +
 +
<pre>
 +
/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;
 +
    ^
 +
</pre>
 +
 +
<b>Replace code like this:</b>
 +
 +
<pre>
 +
    ifstream input;
 +
    ofstream output;
 +
</pre>
 +
 +
<b>By this:</b>
 +
 +
<pre>
 +
    std::ifstream input;
 +
    std::ofstream output;
 +
</pre>
 +
 +
<b>References:</b>
 +
 +
* https://gitlab.kitware.com/vtk/vtk/-/issues/17740

Revision as of 20:48, 18 May 2021

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::

To fix warning message 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: