hi,
i downloaded the book on C++ "T1C2Vone.pdf" from
http://www.planetpdf.com,and started to read,the book is so comprehensive,this is the first program in the book for C++:
// :co2:Hello.cpp
// Saying Hello with c++
#include <iostream>
using namespace std;
int main() {
cout << "Hello World! I am "
<< 8 << " Today! " << endl;
} ///:~
but this frist program failed to compile this is the output:
[root@localhost co2]# gcc -o Hello Hello.cpp
/tmp/ccNbJLzb.o(.text+0x14): In function `main':
: undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::endl<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&)'
/tmp/ccNbJLzb.o(.text+0x2e): In function `main':
: undefined reference to `std::cout'
/tmp/ccNbJLzb.o(.text+0x33): In function `main':
: undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std:
perator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)'
/tmp/ccNbJLzb.o(.text+0x3c): In function `main':
: undefined reference to `std::basic_ostream<char, std::char_traits<char> >:
perator<<(int)'
/tmp/ccNbJLzb.o(.text+0x45): In function `main':
: undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std:
perator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)'
/tmp/ccNbJLzb.o(.text+0x4e): In function `main':
: undefined reference to `std::basic_ostream<char, std::char_traits<char> >:
perator<<(std::basic_ostream<char, std::char_traits<char> >& (*)(std::basic_ostream<char, std::char_traits<char> >&))'
/tmp/ccNbJLzb.o(.text+0x7a): In function `__static_initialization_and_destruction_0(int, int)':
: undefined reference to `std::ios_base::Init::Init[in-charge]()'
/tmp/ccNbJLzb.o(.text+0xa9): In function `__tcf_0':
: undefined reference to `std::ios_base::Init::~Init [in-charge]()'
/tmp/ccNbJLzb.o(.eh_frame+0x11): undefined reference to `__gxx_personality_v0'
collect2: ld returned 1 exit status
plz help me.