The .cpp extension calls gcc to compile your file as a C ++ file. (See GCC Docs .)
Try compiling the same file, but rename it with the extension .c :
mv test.cpp gcc test.c
Alternatively, you can explicitly specify the language by passing -xc compiler:
gcc -xc -c test.cpp -o test.o
If you run nm test.o in these C versions, you will notice that ___gxx_personality_v0 not specified as a character.
(And if you execute the same command in the object file generated with gcc -c test.cpp -o test.o , the ___gxx_personality_v0 character is ___gxx_personality_v0 .)
garageร trois Oct 26 '09 at 17:13 2009-10-26 17:13
source share