I needed GCC 5+ installed on debian jessie and, as is available for debian testing (at least on jun-16) you can use apt-pinning to install packages available there (see
https://wiki.debian.org/AptPreferences).
To install GCC 5+ from testing on debian jessie using apt-pinning:
Add debian testing repo to your apt sources by creating a file on /etc/apt/sources.list.d folder containing the line deb
ftp.us.debian.org/debian testing main contrib non-free
Instruct debian to use testing sources on certain packages by creating a file on /etc/apt/preferences.d containing the following:
Package: *
Pin: release a=testing
Pin-Priority: 100
You can replace the * by the package name that you want to install from testing (in this case would be gcc), but with Pin-Priority: 100, testing packages will be installed only if explicitly told to apt-get
Update apt database: sudo apt-get update
Install gcc from testing: sudo apt-get install -t testing gcc
Note that using -t testing you tell apt-get to install gcc from testing sources as configured earlier.
I strongly suggest to clean any compilation and re-compile any dependency before compiling your sources again.
Have fun!
Нашел здесь
unix.stackexchange.com/questions/284817/how-to-ins...