Guys, I had the very same problem,trying to learn C by book and and had a very same message. I know whats wrong, below is a link to discussion and , just in case, text of the answer to the problem.
http://www.linuxquestions.org/questi...767#post943767
QUOTE
Re: trouble in functions ( post #3)
quote:
Originally posted by Hamid Moradmand
# gcc -o findmax findmax.cpp
/tmp/ccWOi10S.o(.eh_frame+0x11): undefined reference to `__gxx_personality_v0'
collect2: ld returned 1 exit status
In UNIX/Linux filename extension like .doc .txt .c do not have as much meaning as in Windows/DOS, but the compiler is one of the exceptions: gcc does watch the filename "extensions" (called "file name suffix" in the gcc man page).
Some examples: (there are more. Read "man gcc" for more info on this)
For plain C source files: xxxx.c
For C++ source files: xxxx.C xxxx.cpp xxxx.cc or xxxx.cxx
For header files: xxxx.h
What happens in your case is that you have a C program with an C++ extension: "findmax.cpp", and you try to compile it with the C compiler ("gcc").
Two solutions:
1) Compile your program with the C++ compiler:
g++ -o findmax findmax.cpp
2) Rename your source file to "findmax.c".
I'd recommend the second one, as your program is C code, not a C++.
END OF QUOTE
It works for me