thanks for quick reply, as i said i am a newbie
now i get the following error when compiling:
gcc class.cpp
/tmp/cc1LNGYB.o: In function `__static_initialization_and_destruction_0(int, int)':
class.cpp

.text+0x23): undefined reference to `std::ios_base::Init::Init()'
/tmp/cc1LNGYB.o: In function `__tcf_0':
class.cpp

.text+0x6c): undefined reference to `std::ios_base::Init::~Init()'
/tmp/cc1LNGYB.o: In function `main':
class.cpp

.text+0x98): undefined reference to `std::cout'
class.cpp

.text+0x9d): undefined reference to `std::basic_ostream<char, std::char_traits<char> >::operator<<(bool)'
class.cpp

.text+0xa4): undefined reference to `std::cin'
class.cpp

.text+0xa9): undefined reference to `std::basic_istream<char, std::char_traits<char> >::get()'
class.cpp

.text+0xb0): undefined reference to `std::cin'
class.cpp

.text+0xb5): undefined reference to `std::basic_istream<char, std::char_traits<char> >::get()'
/tmp/cc1LNGYB.o: In function `test::t()':
class.cpp

.text._ZN4test1tEv[test::t()]+0x11): undefined reference to `std::cout'
class.cpp

.text._ZN4test1tEv[test::t()]+0x16): undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)'
class.cpp

.text._ZN4test1tEv[test::t()]+0x24): undefined reference to `std::cin'
class.cpp

.text._ZN4test1tEv[test::t()]+0x29): undefined reference to `std::basic_istream<char, std::char_traits<char> >& std::operator>><char, std::char_traits<char> >(std::basic_istream<char, std::char_traits<char> >&, char&)'
/tmp/cc1LNGYB.o

.eh_frame+0x11): undefined reference to `__gxx_personality_v0'
collect2: ld returned 1 exit status