g++ 4.1 and “was not declared in this scope”

Everything is explained here, the first point of C++ section:

http://gcc.gnu.org/gcc-4.1/changes.html