I want to compile a program by entering through SSH the computer at my institution. I want to compile this program by using a different version of gcc and g++, namely a more recent one with repsect to the default installed one. This means that instead of using gcc-4.9.2 and g++-4.9.2 I would like to use gcc-6.3 and g++-6.3. I can find them already on my computer, in fact I have the folder /opt/gcc-6.3, so I don't have to download them. So what I do is the following
export PATH=/opt/gcc-6.3/bin/:$PATH
export LD_LIBRARY_PATH=/opt/gcc-6.3/lib/:$LD_LIBRARY_PATH
but while gcc seems to work, when I try to compile a c++ program with g++ I get
./[name_of_the_program].x: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version `CXXABI_1.3.9' not found (required by ./[name_of_the_program].x)
./[name_of_the_program].x: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by ./[name_of_the_program].x)
Obviously, if that's relevant information, I am not root on this machine.