【发布时间】:2011-06-07 08:21:16
【问题描述】:
我在 Ubuntu 环境中使用 gcc 编译器编写了一个简单的 C 程序。代码很简单。但是,当我尝试编译时,它给出了一个我无法理解的错误。这是代码和错误
# include <stdio.h>
int main() {
enum mar_status {
single,married,divorced
};
enum mar_status person1,person2;
person1 = single;
printf("%d\n",person1); //line B
}
编译时出现以下错误
gcc enum2.cc
/tmp/cc6stgaW.o:(.eh_frame+0x11): undefined reference to `__gxx_personality_v0' collect2: ld returned 1 exit status
如果我删除 B 行的 printf 语句,一切都会正常。关于编译为什么失败的任何想法?
【问题讨论】:
标签: c gcc compiler-errors