# VTK v5.4.2 on Ubuntu (in WSL2)

**URL:** https://discourse.vtk.org/t/vtk-v5-4-2-on-ubuntu-in-wsl2/9938
**Category:** Support
**Created:** [November 23, 2022, 12:55pm UTC](https://discourse.vtk.org/t/vtk-v5-4-2-on-ubuntu-in-wsl2/9938 "2022-11-23T12:55:05Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![lbuo](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/l/85f322/32.png) [@lbuo](https://discourse.vtk.org/u/lbuo)
#### Post date: [November 23, 2022, 12:55pm UTC](https://discourse.vtk.org/t/vtk-v5-4-2-on-ubuntu-in-wsl2/9938/1 "2022-11-23T12:55:05Z")

</div>

Hello everybody.

I was trying to install VTK v5.4.2 on Ubuntu (in WSL2).  
Those are my steps (starting from my home directory):

1. git clone -b v5.4.2 [https://gitlab.kitware.com/vtk/vtk](https://gitlab.kitware.com/vtk/vtk)
2. mkdir VTK-linux
3. cd VTK-linux
4. ccmake …/vtk
5. set the CMAKE\_CXX\_FLAGS to “-std=c++03” → this was to fix an error I was getting later on during “make install”; the error was about some kind of number format conversion
6. make install

Here is the problem. “Make install” reaches the 87% and then I get:  
vtk/Infovis/vtkOrderStatistics.cxx:107:52: error: call of overloaded ‘div(int, vtkIdType&)’ is ambiguous  
107 | div\_t q = div( i \<\< 2, this-\>NumberOfIntervals );  
/usr/include/c++/9/cstdlib:213:3: note: candidate: ‘lldiv\_t \_\_gnu\_cxx::div(long long int, long long int)’  
213 | div(long long \_\_n, long long \_\_d)  
| ^~~  
/usr/include/c++/9/cstdlib:177:3: note: candidate: ‘ldiv\_t std::div(long int, long int)’  
177 | div(long \_\_i, long \_\_j) { return ldiv(\_\_i, \_\_j); }  
| ^~~  
make[2]: \*\*\* [Infovis/CMakeFiles/vtkInfovis.dir/build.make:609: Infovis/CMakeFiles/vtkInfovis.dir/vtkOrderStatistics.o] Error 1  
make[1]: \*\*\* [CMakeFiles/Makefile2:3193: Infovis/CMakeFiles/vtkInfovis.dir/all] Error 2  
make: \*\*\* [Makefile:141: all] Error 2

I am completely stuck and no clue on how to fix it.  
Could any of you give me some help?  
Thanks in advance.

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.vtk.org/user_avatar/discourse.vtk.org/mwestphal/32/19_2.png) [@mwestphal](https://discourse.vtk.org/u/mwestphal)
#### Post date: [November 23, 2022, 1:00pm UTC](https://discourse.vtk.org/t/vtk-v5-4-2-on-ubuntu-in-wsl2/9938/2 "2022-11-23T13:00:23Z")

</div>

Hi @lbuo

VTK 5.4.2 is ancient (2009) and WSL is not officially supported by VTK, even the last release.

I’d suggest to build VTK 9.2.0 on Windows directly, you can follow the guide here:  
[https://gitlab.kitware.com/vtk/vtk/-/blob/master/Documentation/dev/build.md#windows](https://gitlab.kitware.com/vtk/vtk/-/blob/master/Documentation/dev/build.md#windows)

Best,

---

<div class="post-metadata">

### Author: ![dgobbi](https://discourse.vtk.org/user_avatar/discourse.vtk.org/dgobbi/32/18_2.png) [@dgobbi](https://discourse.vtk.org/u/dgobbi)
#### Post date: [November 23, 2022, 1:15pm UTC](https://discourse.vtk.org/t/vtk-v5-4-2-on-ubuntu-in-wsl2/9938/3 "2022-11-23T13:15:46Z")

</div>

To fix that error, try setting `VTK_USE_64BIT_IDS=OFF` in ccmake.

---

<div class="post-metadata">

### Author: ![lbuo](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/l/85f322/32.png) [@lbuo](https://discourse.vtk.org/u/lbuo)
#### Post date: [November 23, 2022, 1:38pm UTC](https://discourse.vtk.org/t/vtk-v5-4-2-on-ubuntu-in-wsl2/9938/4 "2022-11-23T13:38:23Z")

</div>

@dgobbi  
Brilliant! It worked.  
Thanks so much mate!
