# Fatal Error while building ITK-4.8.2

**URL:** <https://discourse.itk.org/t/fatal-error-while-building-itk-4-8-2/3928>\
**Category:** Beginner Questions\
**Tags:** build, cmake\
**Created:** [March 4, 2021, 7:06pm UTC](https://discourse.itk.org/t/fatal-error-while-building-itk-4-8-2/3928 "2021-03-04T19:06:05Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![vtetz](https://discourse.itk.org/letter_avatar_proxy/v4/letter/v/e480ec/32.png) [@vtetz](https://discourse.itk.org/u/vtetz)\
**Post date:** [March 4, 2021, 7:06pm UTC](https://discourse.itk.org/t/fatal-error-while-building-itk-4-8-2/3928/1 "2021-03-04T19:06:05Z")

</div>

I’ve been trying to install the **ITK-4.8.2** , in order to try to build an elder program (constructed in 2018 - a module for 3D Slicer).  
The ITK-5 wasnt working to build this program, so I started to go back, in order to be able to build it.  
So I came back with **CMake 3.10.3** (which configurated and generated without problemns the ITK files). When I try to build the ITK, using _make_, the machine starts to colapse the compilation because of mistakes.  
Firt, I had a problem where the answer was _Dunno about this gcc_ (we laughed with the answer, also cried), which I fixed, including the GCC version, **gcc 9.3.0** , in the file **vcl\_compiler.h** (as it follows below):

// elif (_GNUC_==9)  
// define VCL\_GCC\_9  
// if (_GNUC\_MINOR_\>0)  
// define VCL\_GCC\_93  
// else  
// define VCL\_GCC\_90  
// endif

After this was fixes, I get to the current problem:

// […]  
// [2%] Building CXX object Modules/ThirdParty/VNL/src/vxl/core/vnl/CMakeFiles/itkvnl.dir/vnl\_matlab\_write.cxx.o  
// [2%] Building CXX object Modules/ThirdParty/VNL/src/vxl/core/vnl/CMakeFiles/itkvnl.dir/vnl\_matlab\_read.cxx.o  
// In file included from /home/vivian/Sources/itk-4.8.2/InsightToolkit-4.8.2/Modules/ThirdParty/VNL/src/vxl/core/vnl/vnl\_matlab\_read.cxx:223:  
/home/vivian/Sources/itk-4.8.2/InsightToolkit-4.8.2/Modules/ThirdParty/VNL/src/vxl/vcl/vcl\_new.h:19:11: **fatal error: new.h: No such file or directory**  
19 | # include **\<new.h\>**  
| ^~~  
compilation terminated.

I understand that the header file in _include_ is missing, but I don’t know how to find it, or write it, or how to proceed.

---

<div class="post-metadata">

**Author:** ![dzenanz](https://discourse.itk.org/user_avatar/discourse.itk.org/dzenanz/32/1093_2.png) [@dzenanz](https://discourse.itk.org/u/dzenanz)\
**Post date:** [March 4, 2021, 9:44pm UTC](https://discourse.itk.org/t/fatal-error-while-building-itk-4-8-2/3928/2 "2021-03-04T21:44:53Z")

</div>

I guess that GCC 9 is way to new for ITK 4.8. Try using GCC 4.8.x, or GCC 5.4. Otherwise you could try searching for GCC-specific compile fixes added since then, and backport them to ITK 4.8.

---

<div class="post-metadata">

**Author:** ![vtetz](https://discourse.itk.org/letter_avatar_proxy/v4/letter/v/e480ec/32.png) [@vtetz](https://discourse.itk.org/u/vtetz)\
**Post date:** [March 5, 2021, 1:05pm UTC](https://discourse.itk.org/t/fatal-error-while-building-itk-4-8-2/3928/3 "2021-03-05T13:05:05Z")

</div>

Can I have two different versions of GCC on my machine?  
I found a reference from gcc gnu, I will try it:[https://gcc.gnu.org/faq.html#multiple](https://gcc.gnu.org/faq.html#multiple)  
As a second question, suppousing that I have the two GCC versions, how do I set in CMake the older version of GCC (4.8.x) in order to configure and generate de Makefile of ITK, so I can build it?

---

<div class="post-metadata">

**Author:** ![vtetz](https://discourse.itk.org/letter_avatar_proxy/v4/letter/v/e480ec/32.png) [@vtetz](https://discourse.itk.org/u/vtetz)\
**Post date:** [March 5, 2021, 1:24pm UTC](https://discourse.itk.org/t/fatal-error-while-building-itk-4-8-2/3928/4 "2021-03-05T13:24:50Z")

</div>

I think that here is explained how can I change the compilers when choosing to use it:  
[https://linuxconfig.org/how-to-switch-between-multiple-gcc-and-g-compiler-versions-on-ubuntu-20-04-lts-focal-fossa](https://linuxconfig.org/how-to-switch-between-multiple-gcc-and-g-compiler-versions-on-ubuntu-20-04-lts-focal-fossa)

---

<div class="post-metadata">

**Author:** ![dzenanz](https://discourse.itk.org/user_avatar/discourse.itk.org/dzenanz/32/1093_2.png) [@dzenanz](https://discourse.itk.org/u/dzenanz)\
**Post date:** [March 5, 2021, 9:25pm UTC](https://discourse.itk.org/t/fatal-error-while-building-itk-4-8-2/3928/5 "2021-03-05T21:25:52Z")

</div>

You don’t have to change your platform defaults. Set `CC` and `CXX` environment variables (more on [SO](https://stackoverflow.com/a/17275650/276168)).
