Hi folks,
I am new to this forum. Am 25 years old, I am working in the computer-area for about 9 years now (if you count my aprenticeship) but never got the hang of programming myself.
Sure, I had the basics about C and Java2 and stuff, but never really got over that.
So I thought I'd start with programming anew, and found this site.
When I try to compile the first Program of the first lesson:
I get a strange error.Code:#include <iostream> using namespace std; int main() { cout<<"HEY, you, I'm alive! Oh, and Hello World!\n"; cin.get(); }
This is what I do:
- type the above with nano on the command-line (am on MacOSX now, but I did this with Linux too to confirm the error)
- save it as hello.cpp
- exit nano
- execute "gcc hello.cpp" or "gcc hello.cpp -o hello"
- I get the following:
What seems to be the problem??Code:bash-3.2$ gcc hello.cpp Undefined symbols: "___gxx_personality_v0", referenced from: ___gxx_personality_v0$non_lazy_ptr in cciNlgWN.o "std::basic_istream<char, std::char_traits<char> >::get()", referenced from: _main in cciNlgWN.o "std::ios_base::Init::~Init()", referenced from: ___tcf_0 in cciNlgWN.o "std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)", referenced from: _main in cciNlgWN.o "std::ios_base::Init::Init()", referenced from: __static_initialization_and_destruction_0(int, int)in cciNlgWN.o "std::cin", referenced from: __ZSt3cin$non_lazy_ptr in cciNlgWN.o "std::cout", referenced from: __ZSt4cout$non_lazy_ptr in cciNlgWN.o ld: symbol(s) not found collect2: ld returned 1 exit status bash-3.2$
I simply have no clue whatsoever!
Thx for any help, will be apreciated!
twilight



LinkBack URL
About LinkBacks



