Hi,
I am using Fedora core 5 32 bit Linux. Just wrote this small C++ prgram and saved it as test.cpp on the desktop and then tried to compile it using the terminal with the following command
gcc test.cpp - o test
but it is showing the following message as the ouput,
gcc test.cpp -o test
/tmp/ccYvtTgk.o: In function `__static_initialization_and_destruction_0(int, int)':test.cpp:(.text+0x23): undefined reference to `std::ios_base::Init::Init()'
/tmp/ccYvtTgk.o: In function `__tcf_0':test.cpp:(.text+0x6c): undefined reference to `std::ios_base::Init::~Init()'
/tmp/ccYvtTgk.o: In function `main':test.cpp:(.text+0x8e): undefined reference to `std::cout'
:test.cpp:(.text+0x93): 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*)'
:test.cpp:(.text+0x9a): undefined reference to `std::cin'
:test.cpp:(.text+0x9f): undefined reference to `std::basic_istream<char, std::char_traits<char> >::get()'
/tmp/ccYvtTgk.o:(.eh_frame+0x11): undefined reference to `__gxx_personality_v0'
collect2: ld returned 1 exit status
You have new mail in /var/spool/mail/root
Can't figure out what is the cause here. Help please. Thanks.