erelsgl@ubuntu:/etc/apt$ which g++
erelsgl@ubuntu:/etc/apt$
erelsgl@ubuntu:/etc/apt$ g++
The program 'g++' can be found in the following packages:
* g++
* pentium-builder
Try: sudo apt-get install <selected package>

I didn't find a solution to this and other similar problems in my Ubuntu 10.04, so finally I upgraded to 12.04 and now everything works fine... Sometimes, the package system gets confused, so the best solution is just to upgrade.