In file included from progname.c:26: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"); ^ Makefile:914: recipe for target 'progname.o' failed make[2]: *** [progname.o] Error 1 make[2]: Leaving directory '/usr/local/src/libiconv-1.14/srclib' Makefile:865: recipe for target 'all' failed make[1]: *** [all] Error 2 make[1]: Leaving directory '/usr/local/src/libiconv-1.14/srclib' Makefile:33: recipe for target 'all' failed make: *** [all] Error 2

解决办法
1、编辑源码包目录下的stdio.in.h文件
# vi /usr/local/src/libiconv-1.14/srclib/stdio.in.h
通过关键字 gets 找到
/* It is very rare that the developer ever has full control of stdin, so any use of gets warrants an unconditional warning. Assume it is always declared, since it is required by C89. */ _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

或者直接删除
/* It is very rare that the developer ever has full control of stdin, so any use of gets warrants an unconditional warning. Assume it is always declared, since it is required by C89. */ _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
然后重新make && make install,问题解决。

