zoukankan      html  css  js  c++  java
  • 源码编译安装 libiconv-1.14(php依赖)

    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. [root@ip-172-31-29-70 libiconv-1.14]# find / -name 'stdio.in.h'


    编辑该文件

    1. [root@ip-172-31-29-70 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):

    重新编译即可!

     
     
  • 相关阅读:
    ? ?? 类?
    类 建索引
    访问局域网计算机文件
    JS 在元素后面添加新的元素
    js 网页加载完毕,执行js函数
    设置快捷键(3种方式)
    winform设置textbox设置水印
    ADO.NET 学生管理
    C#整理 条件语句
    ADO.NET 数据访问类查询、属性扩展
  • 原文地址:https://www.cnblogs.com/A121/p/10069601.html
Copyright © 2011-2022 走看看