'gets' undeclared here (not in a function)

今天搭建环境的时候,出现了'gets' undeclared here (not in a function)问题,查了一些资料。根据http://forum.z27315.com/topic/15662-解决编译libiconv时的gets-undeclared-here错误/     的步骤,解决了问题。

我也是下载了补丁包,但是不会解压。。所有没有用这个补丁包。有会解压这个补丁的请告诉我一下。谢谢。

下面说说我是怎么解决的:

1、在命令行输入:find -name stdio.in.h。查到有两个文件中含有stdio.in.h.

./huangwork/atom-sdk/install_sdk/IntelCE-0.34.13452.340510/project_build_i686/IntelCE/autotools-0.29.12293.323798/building/m4-1.4.13/lib/stdio.in.h
./huangwork/atom-sdk/install_sdk/IntelCE-0.34.13452.340510/project_build_i686/IntelCE/bison-0.29.12232.321541/bison-2.4.2/lib/stdio.in.h
 
2、打开第一个文件中的stdio.in.h,没有找到
_GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");
打开第二个找到了。
然后
-_GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead"); +#if defined(__GLIBC__) && !defined(__UCLIBC__) && !__GLIBC_PREREQ(2, 16) + _GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead"); +#endif #endif

即:把第一行注释掉,所以用-表示注释,然后添加第二行和第三行。最后不要忘了添加#endif。
3、编译,通过!!!!
 
非常感谢网友的帮助。

转载于:https://www.cnblogs.com/hjj801006/p/3988220.html

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值