Ubuntu14.04_64编译libiconv出问题 ./stdio.h:1010:1: error: 'gets' undeclared here (not in a function)

一、错误现象

环境 Ubuntu14.04 64位 编译libiconv-1.14 出错

错误现象:

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] 错误 1
make[2]:正在离开目录 `/home/bupt/miao/Box/soft/libiconv-1.14/srclib'
make[1]: *** [all] 错误 2
make[1]:正在离开目录 `/home/bupt/miao/Box/soft/libiconv-1.14/srclib'

make: *** [all] 错误 2

二、解决方法

在libiconv-1.14/srclib/stdio.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");
#endif

重新编译libiconv就OK了.

相关文章

目录前言一、创建Hadoop用户二、更新apt和安装Vim编辑器三、...
原文连接:https://www.cnblogs.com/yasmi/p/5192694.html ...
电脑重启后,打开VirtualBox,发现一直用的虚拟机莫名的消失...
参见:https://blog.csdn.net/weixin_38883338/article/deta...
Ubuntu 18.04 LTS 已切换到 Netplan 来配置网络接口。Netpla...
介绍每个 Web 服务都可以通过特定的 URL 在 Internet 上访问...