centos7编译libiconv报错:./stdio.h:1010:1: error: 'gets' undeclared here (not in a function)

如题:配置编译参数通过,在进行 make 的时候报如下错误:

  1. In 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. ^
  5. make[2]: *** [progname.o] Error 1
  6. make[2]: Leaving directory `/usr/local/src/zabbix-2.4.7/libiconv-1.14/srclib‘
  7. make[1]: *** [all] Error 2
  8. make[1]: Leaving directory `/usr/local/src/zabbix-2.4.7/libiconv-1.14/srclib‘
  9. make: *** [all] Error 2

复制代码

解决方法:

使用 find 查找 stion.in.h 文件:

  1. [[email protected] libiconv-1.14]# find / -name ‘stdio.in.h‘

复制代码

编辑该文件

  1. [[email protected] libiconv-1.14]# vim /usr/local/src/zabbix-2.4.7/libiconv-1.14/srclib/stdio.in.h

复制代码

通过关键字 gets 找到698 行,将其和695行一同注释:

  1. 695 /* It is very rare that the developer ever has full control of stdin,
  2. 696    so any use of gets warrants an unconditional warning.  Assume it is
  3. 697    always declared, since it is required by C89.
  4. 698 _GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");*/

复制代码

然后再注释的行下面添加以下三行:

  1. #if defined(__GLIBC__) && !defined(__UCLIBC__) && !__GLIBC_PREREQ(2, 16)
  2. _GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");
  3. #endif

复制代码

保存退出!(注意#endif 下面还有一个 #endif):

重新编译即可!

centos7编译libiconv报错:./stdio.h:1010:1: error: 'gets' undeclared here (not in a function)

原文地址:https://www.cnblogs.com/A121/p/10342226.html

时间: 2024-10-11 19:40:15

centos7编译libiconv报错:./stdio.h:1010:1: error: 'gets' undeclared here (not in a function)的相关文章

编译安装libiconv报错:./stdio.h:1010:1: error: 'gets' undeclared here (not in a function)

错误如下:     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     m

编译nagios-plugins报错./stdio.h:456:1:

在AWS的EC2上编译nagios-plugins报错: ./stdio.h:456:1: error: 'gets' undeclared here (not in a function) make[4]: *** [localcharset.o] Error 1 make[4]: Leaving directory `/root/nagios-plugins-1.4.16/gl' make[3]: *** [all-recursive] Error 1 make[3]: Leaving di

nagios报错:./stdio.h:456:1: error: 'gets' undeclared here (not in a function)

[[email protected] nagios-plugins-1.4.16]# ./configure [[email protected] nagios-plugins-1.4.16]# make  mv -f .deps/full-write.Tpo .deps/full-write.Po gcc -DHAVE_CONFIG_H -I. -I..  -I../intl   -g -O2 -MT localcharset.o -MD -MP -MF .deps/localcharset.

Mac编译mcrypt报错malloc.h不存在

mac下编译mcrypt的时候总是报错, 起初提示 rm: conftest.dSYM: is a directory checking if gcc supports -fno-rtti -fno-exceptions... yes checking for gcc option to produce PIC... -fno-common -DPIC checking if gcc PIC flag -fno-common -DPIC works... yes checking if gcc

编译安装libiconv报错

环境:centos 7.1 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]: Leavin

PHP编译安装报错: mcrypt.h not found. Please reinstall libmcrypt.

PHP编译安装报错: mcrypt.h not found. Please reinstall libmcrypt. 转载2016-04-25 12:40:44 标签:linuxitphp 解决方法: 1.为系统安装perl-Geo-IP,默认yum源中没有这个包,特意安装epel第三方yum源[[email protected] ~] rpm -Uvh http://mirrors.sohu.com/fedora-epel/6/x86_64/epel-release-6-8.noarch.rp

Xcode6编译SDWebImage报错原因分析(SDWebImageDownloaderOperation.m错误)

之前写了一片关于编译SDWebImage报错解决方法的文章: http://blog.csdn.net/cuibo1123/article/details/39434015 结果很多人问这个问题的原因,那就在这里给大家说一说好了,分析思路一并送上(不过我还是建议大家自己动手去分析). 首先,如果新建工程,按照SDWebImage的方式声明输出口并引用: @interface ZCTest () @property (assign, nonatomic, getter = isExecuting)

源码编译php-5 报错整理

阿里云上 源码编译 php 报错的集中整理 [[email protected] php-5.5.31]#   ./configure --prefix=/module/application/php-5.5/--enable-pcntl --enable-fpm --enable-posix --enable-mysqlnd --enable-sockets --enable-sysvmsg --enable-sysvsem --enable-sysvshm --enable-shmop --

PHP安装mcrypt.so报错 mcrypt.h not found 的解决办法

报错内容:configure: error: mcrypt.h not found. Please reinstall libmcrypt 网上搜索了很多,包括自带的 yum install libmcrypt libmcrypt-devel,这个是没有效果的. 去SourceForget下载libmcrypt http://sourceforge.net/projects/mcrypt/files/Libmcrypt/ ,最新版是mcrypt 2.6.7.gz.下载下来安装仍旧报错libmcr