centos安装nginx 编译时报错_CentOS7下安装libiconv时报错‘gets undeclared here (not in a function)的...

在编译过程中遇到stdio.h中gets未声明的错误,这由于_G LWARN_ON_USE(gets, "gets是安全隐患–使用fgets代替")导致。解决方案是修改srclib/stdio.in.h文件,条件编译部分,将警告语句注释掉。修改后重新configure和make,编译通过。
摘要由CSDN通过智能技术生成

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

./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”);

b351922bef34fb8d7978c18e8bfa11b7.png

解决方法:

修改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

修改前如下:

190af6b6d6dcf07c1f40fe9cd8ce524e.png

修改后如下:

b0f327b17a289182d2c71fcc762b8dd4.png

重新configure,再make,通过。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值