Probably you try to compile a C++ code with gcc instead of g++

gcc test.cpp
Undefined symbols:
  "___gxx_personality_v0", referenced from ...
...

Use g++ instead:

g++ test.cpp