Following is the code which works on windows but can't work with g++ template < class my_type> class mytypedef { public : typedef my_type new_type; }; template <class my_type> class sample: public mytypedef < my_type > { public : new_type var; }; Error : new_type doest not name a type. Why is it happening? What is solution for this problem? Amol Gajewar