记一次 libiconv 编译错误

该文章根据 CC-BY-4.0 协议发表,转载请遵循该协议。
本文地址:https://fenying.net/post/2016/07/07/memo-about-libiconv-compilation-failure/

今天编译 PHP 时漏了安装 libiconv,于是去编译了一次 libiconv,结果编译报错了。

报错如下:

1In file included from progname.c:26:0:
2./stdio.h:1010:1: error: gets undeclared here (not in a function)
3_GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");
4^
5make[1]: *** [progname.o] Error 1

谷歌了一番,在 这里 找到了解决方案:

在文件 libiconv/srclib/stdio.in.h 中找到行

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

将其注释掉,然后重新编译

1make clean && make && make install

一切搞定。

comments powered by Disqus