[MISTAKEs] UPPER LETTER POSTFIX IS A C++ FILE

来源:互联网 发布:淘宝店铺推荐 编辑:程序博客网 时间:2024/05/17 07:52

when i use command

gcc BIT_AND.C -o bit_and


and the OS gives me a message:

/tmp/ccXqde6p.o:(.eh_frame+0x12): undefined reference to `__gxx_personality_v0'

collect2: ld returned 1 exit status



solution is:

You should use g++, not gcc, to compile C++ programs.

postfix '.C' upper letter 'C', it means the file is a C++ source. you should use g++ to compile it.

原创粉丝点击