帮助中心 >  技术知识库 >  数据库 >  相关技术支持 >  如何处理stdio.h:1010:1: error: 'gets;undeclared here (not in a function)

如何处理stdio.h:1010:1: error: 'gets;undeclared here (not in a function)

2019-04-08 14:52:14 15512

在编译安装libiconv提示如下错误:
stdio.h:1010:1: error: 'gets;undeclared here (not in a function)

1.png

解决方法:

找到stion.in.h文件,在文件中通过关键字gets找到698行位置将其 和695行一同注释
然后在注释行下面添加下面三行
   #if defined(__GLIBC__) && !defined(__UCLIBC__) && !__GLIBC_PREREQ(2, 16)

_GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");

#endif

   2.png

保存退出!(注意#endif 下面还有一个 #endif):

重新编译即可!


提交成功!非常感谢您的反馈,我们会继续努力做到更好!

这条文档是否有帮助解决问题?

非常抱歉未能帮助到您。为了给您提供更好的服务,我们很需要您进一步的反馈信息:

在文档使用中是否遇到以下问题: