现在的位置: 首页 > 综合 > 正文

用gcc编译.cpp文件可能出现”undefined reference to `__gxx_personality_v0′”问题的解决

2014年01月02日 ⁄ 综合 ⁄ 共 308字 ⁄ 字号 评论关闭

用gcc编译.cpp文件时出现undefined reference to `__gxx_personality_v0',可能某些gcc不支持,具体是什么问题,我也没有弄清楚(如果哪位大侠高清楚了,请告知).

解决的办法就是通过g++来编译,就可以通过了!!

如我编译文件ds_attr.cpp

# gcc -ldb -o ds_attr ds_attr.cp

/tmp/ccytkpsi.o(.eh_frame+0x11): undefined reference to `__gxx_personality_v0'
collect2: ld returned 1 exit status

# g++ -ldb -o ds_attr ds_attr.cp

sucess!!

抱歉!评论已关闭.