I'm trying to learn c++ as well.
I followed your link. It seems to have a TON of information. but when I try to compile to first program, i get a bunch of errors.
The code is:
#include <iostream>
using namespace std;
int main()
{
cout<<"HEY, you, I'm alive! Oh, and Hello World!\n";
cin.get();
}
i type in this at the terminal:
gcc f.cpp -o hello
and I get the following errors:
/tmp/ccpI2yKM.o(.text+0x19): In function `main':
: undefined reference to `std::cout'
/tmp/ccpI2yKM.o(.text+0x1e): 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/ccpI2yKM.o(.text+0x29): In function `main':
: undefined reference to `std::cin'
/tmp/ccpI2yKM.o(.text+0x2e): In function `main':
: undefined reference to `std::basic_istream<char, std::char_traits<char> >::get()'
/tmp/ccpI2yKM.o(.text+0x5a): In function `__static_initialization_and_destruction_0(int, int)':
: undefined reference to `std::ios_base::Init::Init[in-charge]()'
/tmp/ccpI2yKM.o(.text+0x89): In function `__tcf_0':
: undefined reference to `std::ios_base::Init::~Init [in-charge]()'
/tmp/ccpI2yKM.o(.eh_frame+0x11): undefined reference to `__gxx_personality_v0'
collect2: ld returned 1 exit status
I'm using fedora core 2, and I'm almost certain I've used gcc in the past and made it work, maybe I had to much Amaretto that night...?