"Puetz, Oliver P11M22" <[EMAIL PROTECTED]> writes: > here's a little sample code, which could be compiled with g++ 3.01 under > hp-ux, but when compiled with g++ 3.4.6 under linux, following error > occured: > > sample.c: In member function 'T C2<T>::PROC(T)': > sample.c:19: error: 'c1i' was not declared in this scope
The question is not appropriate for the gcc@gcc.gnu.org mailing list. It would be appropriate on the [EMAIL PROTECTED] mailing list. The actual problem is happening because g++ 3.4.6 does a better job of implementating the standard C++ language. You are falling afoul of the two-phase lookup rule. The easiest fix is to change the line to T PROC(T x) { this->c1i = c2i; }; Further questions on this topic should be taken to a C++ standard FAQ. Ian