编译安装libiconv报错:./stdio.h:1010:1: error: 'gets' undeclared here (not in a function)

问题:

1
2
3
4
5
6
7
8
9
In  file  included from progname.c:26:0:
     . /stdio .h:1010:1: error: ‘gets’ undeclared here (not  in  function )
     _GL_WARN_ON_USE (gets,  "gets is a security hole - use fgets instead" );
     ^
     make [2]: *** [progname.o] Error 1
     make [2]: Leaving directory ` /usr/local/src/zabbix-2 .4.7 /libiconv-1 .14 /srclib '
     make [1]: *** [all] Error 2
     make [1]: Leaving directory ` /usr/local/src/zabbix-2 .4.7 /libiconv-1 .14 /srclib '
     make : *** [all] Error 2

解决:

1
2
3
4
5
6
7
8
9
10
11
vi  . /srclib/stdio . in .h
  
注释掉698这一行
/*_GL_WARN_ON_USE (gets,  "gets is a security hole - use fgets instead" );*/
  
原处添加下面3行
#if defined(__GLIBC__) && !defined(__UCLIBC__) && !__GLIBC_PREREQ(2, 16)
  _GL_WARN_ON_USE (gets,  "gets is a security hole - use fgets instead" );
#endif
  
!注意下面还是有一个 #endif


      本文转自无形于有形  51CTO博客,原文链接:http://blog.51cto.com/jinchuang/1947011,如需转载请自行联系原作者




评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值