如何处理stdio.h:1010:1: error: 'gets;undeclared here (not in a function)
2019-04-08 14:52:14

在编译安装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):

重新编译即可!