the error message : Pkg g++ is not available but is referred to by another pkg.This may mean that the pkg is missing /obsoleted or is only available from another source.
Pkg G++ has no installation candidate.
end of error message
$sudo gedit /etc/apt/sources.list
when the file opened put # as the first charactre of each line save file
and put ubuntu installation cd to optical drive
then try this and it will solve your problem
$sudo apt-get install g++