Home:ALL Converter>Undefined Symbol ___gxx_personality_v0 on link

Undefined Symbol ___gxx_personality_v0 on link

Ask Time:2008-10-15T10:36:38         Author:ryan_s

Json Formatter

I've been getting this undefined symbol building with this command line:

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

test.cpp is simple and should build fine. What is the deal?

Author:ryan_s,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/203548/undefined-symbol-gxx-personality-v0-on-link
pseudosudo :

The .cpp extension causes gcc to compile your file as a C++ file. (See the GCC docs.)\n\nTry compiling the same file, but rename it to have a .c extension:\n\nmv test.cpp\ngcc test.c\n\n\nAlternatively, you can explicitly specify the language by passing -x c to the compiler:\n\ngcc -x c -c test.cpp -o test.o\n\n\n\n\nIf you run nm test.o on these C-language versions, you'll notice that ___gxx_personality_v0 is not listed as a symbol.\n(And if you run the same command on an object file generated with gcc -c test.cpp -o test.o, the ___gxx_personality_v0 symbol is present.)",
2009-10-26T17:13:21
inket :

Just in case anyone has the same problem as me: The file extension should be a .c not a .C (gcc is case-sensitive).",
2010-12-02T22:08:38
yy