Spec2006 编译错误 md5sum.c: conflicting types for 'getline'

参考:getline conflicting

问题来源: spec2006 编译的过程中出现如下错误

In file included from md5sum.c:38:0:
lib/getline.h:31:1: error: conflicting types for 'getline'
/usr/include/stdio.h:675:20: note: previous declaration of 'getline' was here
lib/getline.h:34:1: error: conflicting types for 'getdelim'
/usr/include/stdio.h:665:20: note: previous declaration of 'getdelim' was here

解决方法: 出现这个错误主要是由于stdio.h库已经定义getline和getdelim函数,而spec中的getline.h中也定义了该函数,从而造成冲突。

现在只需要将getline.h和getline.c中所有的getline和getdelim函数更改为自定的函数名称即可,例如get_line(…)和getdelim(…)等。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值