安装php环境前,安装包libiconv-devel出错
# make 报错如下:
make[2]: Entering directory `/opt/libiconv-1.14/srclib‘
make[3]: Entering directory `/opt/libiconv-1.14‘
make[3]: Nothing to be done for `am--refresh‘.
make[3]: Leaving directory `/opt/libiconv-1.14‘
gcc -DHAVE_CONFIG_H -DEXEEXT=\"\" -I. -I.. -I../lib -I../intl -DDEPENDS_ON_LIBICONV=1 -DDEPENDS_ON_LIBINTL=1 -g -O2 -c progname.c
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");
^
make[2]: *** [progname.o] Error 1
make[2]: Leaving directory `/opt/libiconv-1.14/srclib‘
make[1]: *** [all] Error 2
make[1]: Leaving directory `/opt/libiconv-1.14/srclib‘
make: *** [all] Error 2
解决方法
在libiconv/srclib目录执行 sed -i -e ‘/gets is a security/d‘ ./stdio.in.h
编译成功
原文地址:http://bilibili.blog.51cto.com/7121987/1944653