# Build failure with gcc 5.1.0: trying to include iostream.h

**URL:** <https://root-forum.cern.ch/t/build-failure-with-gcc-5-1-0-trying-to-include-iostream-h/19363>\
**Category:** ROOT\
**Created:** [June 10, 2015, 3:25pm UTC](https://root-forum.cern.ch/t/build-failure-with-gcc-5-1-0-trying-to-include-iostream-h/19363 "2015-06-10T15:25:09Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nicola\_Mori](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/nicola_mori/32/23583_2.png) [@Nicola\_Mori](https://root-forum.cern.ch/u/Nicola_Mori)\
**Post date:** [June 10, 2015, 3:25pm UTC](https://root-forum.cern.ch/t/build-failure-with-gcc-5-1-0-trying-to-include-iostream-h/19363/1 "2015-06-10T15:25:09Z")

</div>

I can’t build Root 5.34.25 with gcc 5.1.0. Configuring the build with configure I get this compilation error:

> [@](#):
>
> g++ -g -pipe -m64 -Wall -W -Woverloaded-virtual -fPIC -Iinclude -DR\_\_HAVE\_CONFIG -DG\_\_REGEXP -DG\_\_UNIX -DG\_\_SHAREDLIB -DG\_\_OSFDLL -DG\_\_ROOT -DG\_\_REDIRECTIO -DG\_\_STD\_EXCEPTION -DG\_\_64BIT -DG\_\_HAVE\_CONFIG -DG\_\_NOMAKEINFO -DG\_\_CINTBODY -I/home/mori/software/source/root\_v5.34.25.debug/cint/cint/inc -I/home/mori/software/source/root\_v5.34.25.debug/cint/cint/src -I/home/mori/software/source/root\_v5.34.25.debug/cint/cint/src/dict -pthread -Icint/cint/lib/libstrm -Icint/cint/lib/stream -I. -o cint/cint/src/dict/libstrm.o -c cint/cint/src/dict/libstrm.cxx  
> In file included from cint/cint/src/dict/libstrm.h:37:0,  
> from cint/cint/src/dict/libstrm.cxx:14:  
> cint/cint/lib/stream/iostrm.h:24:22: fatal error: iostream.h: No such file or directory  
> compilation terminated.  
> Makefile:631: recipe for target ‘cint/cint/src/dict/libstrm.o’ failed  
> make: \*\*\* [cint/cint/src/dict/libstrm.o] Error 1

I have previously compiled Root 5.34.25 with gcc 4.9.2 and older without problems. I think that this might be a problem with gcc 5 since I use a bash script to download, configure, build and install, so I’m pretty sure that I’m doing exactly the same things I did with gcc 4.9.2.  
Can anyone confirm this? Or maybe I’m totally wrong? Thanks.

---

<div class="post-metadata">

**Author:** ![tc3t](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/t/c5a1d2/32.png) [@tc3t](https://root-forum.cern.ch/u/tc3t)\
**Post date:** [June 10, 2015, 9:01pm UTC](https://root-forum.cern.ch/t/build-failure-with-gcc-5-1-0-trying-to-include-iostream-h/19363/2 "2015-06-10T21:01:54Z")

</div>

Perhaps [the old .h -headers](https://isocpp.org/wiki/faq/coding-standards#std-headers) are no longer available by default in GCC5 or there’s a configuration error causing cint to try to include those instead of other versions (CINT uses macro G\_\_NEWSTDHEADER to decide which version to include)?

---

<div class="post-metadata">

**Author:** ![Axel](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/axel/32/11084_2.png) [@Axel](https://root-forum.cern.ch/u/Axel)\
**Post date:** [June 11, 2015, 7:37am UTC](https://root-forum.cern.ch/t/build-failure-with-gcc-5-1-0-trying-to-include-iostream-h/19363/3 "2015-06-11T07:37:17Z")

</div>

Hi,

Please move to ROOT 6; we are not going to add support for GCC 5 to ROOT 5.

Cheers, Axel.

---

<div class="post-metadata">

**Author:** ![Nicola\_Mori](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/nicola_mori/32/23583_2.png) [@Nicola\_Mori](https://root-forum.cern.ch/u/Nicola_Mori)\
**Post date:** [June 11, 2015, 11:22am UTC](https://root-forum.cern.ch/t/build-failure-with-gcc-5-1-0-trying-to-include-iostream-h/19363/4 "2015-06-11T11:22:05Z")

</div>

Thanks Axel, understood. FYI, I have been able to compile 5.34.30 with gcc 5.1 (so if no gcc5-specific work has been done between 5.34.25 and 5.34.30 then maybe it’s not a gcc5 issue, but nevertheless the last version works).

---

<div class="post-metadata">

**Author:** ![joa](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/j/dec6dc/32.png) [@joa](https://root-forum.cern.ch/u/joa)\
**Post date:** [September 22, 2015, 10:14am UTC](https://root-forum.cern.ch/t/build-failure-with-gcc-5-1-0-trying-to-include-iostream-h/19363/5 "2015-09-22T10:14:04Z")

</div>

Hi all,

I can understand that the ROOT team has to stop support now and then. But I would really like to compile root5 with gcc5.1 (I guess I could do without but that seems even harder).

Nicola, would it be possible for you to share with me how you managed to do it?

kind regards

Joa

---

<div class="post-metadata">

**Author:** ![Nicola\_Mori](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/nicola_mori/32/23583_2.png) [@Nicola\_Mori](https://root-forum.cern.ch/u/Nicola_Mori)\
**Post date:** [September 22, 2015, 10:18am UTC](https://root-forum.cern.ch/t/build-failure-with-gcc-5-1-0-trying-to-include-iostream-h/19363/6 "2015-09-22T10:18:20Z")

</div>

Hi joa, actually I did nothing special for compiling 5.34.30 with gcc 5. It seems that the problem has been silently fixed, now I’m on gcc 5.2.0 and I have no problem in compiling recent versions of Root 5. I just gave up with Root 5.34.25.

---

<div class="post-metadata">

**Author:** ![joa](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/j/dec6dc/32.png) [@joa](https://root-forum.cern.ch/u/joa)\
**Post date:** [September 22, 2015, 11:21am UTC](https://root-forum.cern.ch/t/build-failure-with-gcc-5-1-0-trying-to-include-iostream-h/19363/7 "2015-09-22T11:21:15Z")

</div>

Hi again,

to summarize

with

g++ --version  
g++ (GCC) 5.1.1 20150618 (Red Hat 5.1.1-4)  
Copyright © 2015 Free Software Foundation, Inc.  
This is free software; see the source for copying conditions. There is NO  
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

I can build root 5.34/30 using the the autoconf tools

./configure --all

but it fails if I try with cmake (which I did first)

cmake -Dminuit2=YES ./…/root

this is good enough for me

cheers

Joa

---

<div class="post-metadata">

**Author:** ![mato](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/mato/32/12317_2.png) [@mato](https://root-forum.cern.ch/u/mato)\
**Post date:** [September 22, 2015, 2:32pm UTC](https://root-forum.cern.ch/t/build-failure-with-gcc-5-1-0-trying-to-include-iostream-h/19363/8 "2015-09-22T14:32:31Z")

</div>

Hi,  
The head of the v5-34-00-patches branch should also work for CMake. We will make a patch release including it soon.

---

<div class="post-metadata">

**Author:** ![Nicola\_Mori](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/nicola_mori/32/23583_2.png) [@Nicola\_Mori](https://root-forum.cern.ch/u/Nicola_Mori)\
**Post date:** [November 17, 2015, 11:03am UTC](https://root-forum.cern.ch/t/build-failure-with-gcc-5-1-0-trying-to-include-iostream-h/19363/9 "2015-11-17T11:03:20Z")

</div>

I had the necessity to compile 5.32.04 with gcc 5 so this time I went deep into the problem. I produced a patch based on commit 7dec562d1d5723b7eea08d08659dc9dc4e79c8ca which fixes the configuration files. I also found that in 5.32 there are code paths which are obsolete in C11 which is the default C dialect for gcc 5, so the gnu99 dialect must be forced with the configure option --with-cc=“gcc -std=gnu99”. I tested it with Root v5.32.04 and gcc 5.2.0 in an ArchLinux system and it worked.  
I attach also the gcc 5 patch for 5.34.00 \<= Root \< 5.34.30, generated with ‘git format-patch -1 7dec562d1d5723b7eea08d08659dc9dc4e79c8ca’ which should be sufficient (i.e. no gnu99 flag needed) for compilation but I have not tested it.  
[ROOT-v5.32-GCC5.txt](https://root-forum.cern.ch/uploads/default/original/2X/a/a1114430050f09786aec0471e05a1fe4e081d589.txt) (2.8 KB)  
[ROOT-v5.34-GCC5.txt](https://root-forum.cern.ch/uploads/default/original/2X/0/051b7c98b444aa8c3203b0e04746dde266198eda.txt) (2.71 KB)
