Add to the end of /etc/apt/sources.list source from 10.04 (lucid)
deb http://mirrors.us.kernel.org/ubuntu/ lucid main universe
Then run
sudo apt-get update
You have to specify version 4.1.2-27, as libstdc++6-4.1-dev has not been back ported to 4.1.2-29.
sudo apt-get install gcc-4.1=4.1.2-27ubuntu1 gcc-4.1-base=4.1.2-27ubuntu1 cpp-4.1=4.1.2-27ubuntu1 g++-4.1