g++: command not found

Have You tried accessing the binary with the full path?

Maybe Your $PATH variable doesn't contain the default paths? echo $PATH should give something like:

[root@server ~]# echo $PATH
/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin

If it's empty, You may set the PATH variable with this command

export PATH="/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin"

On CentOS possible default full paths are:

/usr/bin/g++ - from package: gcc-c++
/usr/lib64/icecc/bin/g++ - from package: icecream
/usr/lib/icecc/bin/g++ - from package: icecream

You may install the required package with command yum install {package}

On Debian possible default full paths are:

/usr/bin/g++ - from package: g++
/usr/bin/g++ - from package: pentium-builder
/usr/lib/icecc/bin/g++ - from package: icecc

You may install the required package with command apt-get install {package}
Error in other languages:
g++: bevel nie gevind nie
g++: comandă negăsită
g++: comando não encontrado
g++: commande introuvable
g++: command not found
g++: käsku ei ole
g++: không tìm thấy lệnh
g++: komanda nerasta
g++: Kommando nicht gefunden.
g++: kommandot finns inte
g++: komut yok
g++: nie znaleziono polecenia
g++: níor aimsíodh an t-ordú
g++: no se encontró la orden
g++: no s'ha trobat l'ordre
g++: opdracht niet gevonden
g++: parancs nem található
g++: perintah tidak ditemukan
g++: príkaz nenájdený
g++: příkaz nenalezen
g++: команда не найдена
g++: командата не е открита
g++: 命令找不到
g++: コマンドが見つかりません