CentOS7下安装libiconv时报错‘gets’ undeclared here (not in a function)的解决方法

Linux 23333 916℃ 0评论

编译安装时出现下列错误,导致编译不通过。

./stdio.h:1010:1: error: ‘gets’ undeclared here (not in a function)

_GL_WARN_ON_USE (gets, “gets is a security hole – use fgets instead”);


解决方法:

  1. 修改srclib/stdio.in.h,将_GL_WARN_ON_USE (gets, “gets is a security hole – use fgets instead”);修改为下列内容,大概在698行。

#if defined(__GLIBC__) && !defined(__UCLIBC__) && !__GLIBC_PREREQ(2, 16)

_GL_WARN_ON_USE (gets, “gets is a security hole – use fgets instead”);

#endif

修改前如下:


修改后如下:


  1. 重新configure,再make,通过。

本文链接地址: CentOS7下安装libiconv时报错‘gets’ undeclared here (not in a function)的解决方法

转载请注明:蛋疼实验室 » CentOS7下安装libiconv时报错‘gets’ undeclared here (not in a function)的解决方法

喜欢 (0)
发表我的评论
取消评论

*

表情 签到

Hi,请填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址