ROOT 6 build from source error gcc 4.7.2

Thanks for your reply.

After some work, I managed to install ROOT v6.07.03 in Debian wheezy.

I post here my solution, in case someone wants to do the same.

First, I built gcc-4.9 from source in a fixed location, /opt in my case:

cd /opt/
unset LIBRARY_PATH CPATH C_INCLUDE_PATH PKG_CONFIG_PATH CPLUS_INCLUDE_PATH INCLUDE
#Check also with printenv, /usr/local/lib and so on... that you do not have any extra personal libraries intefering...
wget http://ftp.gnu.org/gnu/gcc/gcc-4.9.2/gcc-4.9.2.tar.gz
tar xzvf gcc-4.9.2.tar.gz
cd gcc-4.9.2
./contrib/download_prerequisites
#Alternatively, sudo apt-get install libgmp-dev libmpfr-dev libmpc-dev
cd -
mkdir gcc-4.9_build
mkdir gcc-4.9
cd gcc-4.9_build
/opt/gcc-4.9.2/configure --prefix=/opt/gcc-4.9 --disable-multilib
make -j8
make install
#See http://stackoverflow.com/questions/23312047/how-do-i-compile-and-run-gcc-4-9-x
#See http://stackoverflow.com/questions/29981492/gcc-4-9-2-installation-failed-on-linux

Then, I check the prerequisites root.cern.ch/build-prerequisites, I also install ccache, and then I install ROOT from git master with CMake, specifying the actual compiler

sudo apt-get install git dpkg-dev make g++ gcc binutils libx11-dev libxpm-dev \
libxft-dev libxext-dev
sudo apt-get install gfortran libssl-dev libpcre3-dev \
xlibmesa-glu-dev libglew1.5-dev libftgl-dev \
libmysqlclient-dev libfftw3-dev cfitsio-dev \
graphviz-dev libavahi-compat-libdnssd-dev \
libldap2-dev python-dev libxml2-dev libkrb5-dev \
libgsl0-dev libqt4-dev ccache

cd /opt/
mkdir root6
cd root6
git clone http://root.cern.ch/git/root.git root6_src
#Check again that environment is clean, and then export your local libstdc++
export LD_LIBRARY_PATH=/opt/gcc-4.9/lib64/
cmake -Droofit=ON -Dhttp=ON -Dccache=ON -DCMAKE_CXX_COMPILER=/opt/gcc-4.9/bin/g++ -DCMAKE_C_COMPILER=/opt/gcc-4.9/bin/gcc -DCMAKE_Fortran_COMPILER=/opt/gcc-4.9/bin/gfortran /opt/root6/root6_src/
cmake --build .
#If you are in a hurry, then use instead: make -j8

Finally, whenever you want to use ROOT, type this (or write in your ~/.bashrc)

unset CPLUS_INCLUDE_PATH
export PATH=/opt/gcc-4.9/bin/:$PATH
export LD_LIBRARY_PATH=/opt/gcc-4.9/lib64/:$LD_LIBRARY_PATH
source /opt/root6/bin/thisroot.sh
# Or add previous line to ~/.bashrc
root
#root --notebook works also