红联Linux门户
Linux帮助

编译libiconv-1.14错误解决

发布时间:2015-04-15 22:45:07来源:ubuntukylin作者:lenky0401

ubuntukylin 13.04上编译libiconv-1.14

lenky@robert-T430S:~/下载/libiconv-1.14$ ./configure
...
lenky@robert-T430S:~/下载/libiconv-1.14$ make -j4
...
gcc -DHAVE_CONFIG_H -DEXEEXT=\"\" -I. -I.. -I../lib  -I../intl -DDEPENDS_ON_LIBICONV=1 -DDEPENDS_ON_LIBINTL=1   -g -O2 -c -o width.o `test -f 'uniwidth/width.c' || echo './'`uniwidth/width.c
In file included from progname.c:26:0:
./stdio.h:1010:1: 错误: ‘gets’未声明(不在函数内)
gcc -DHAVE_CONFIG_H -DEXEEXT=\"\" -I. -I.. -I../lib  -I../intl -DDEPENDS_ON_LIBICONV=1 -DDEPENDS_ON_LIBINTL=1   -g -O2 -c xmalloc.c
make[2]: *** [progname.o] 错误 1
make[2]: *** 正在等待未完成的任务....
make[2]:正在离开目录 `/home/lenky/下载/libiconv-1.14/srclib'
make[1]: *** [all] 错误 2
make[1]:正在离开目录 `/home/lenky/下载/libiconv-1.14/srclib'
make: *** [all] 错误 2


解决方法:
lenky@robert-T430S:~/下载/libiconv-1.14$ vi srclib/stdio.h

到1010行,注释掉该行即可:
_GL_CXXALIASWARN (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");
#endif

重新make,OK。