centos7下安装libiconv失败

由于需要,需要在centos7中安装libiconv库

centos版本如下

$ cat /etc/redhat-release 
CentOS Linux release 7.4.1708 (Core) 
$ uname -r
3.10.0-693.el7.x86_64

但是在安装过程中遇到了如下问题:

解决方法:
打开libiconv-1.14/srclib/stido.in.h
找到:
_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");

如下,我将原本的注释掉加入


重现编译即可

原文地址:https://www.cnblogs.com/ExzaiTin/p/8259122.html