首页 > 代码库 > 编译安装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 make[2]: Leaving directory `/usr/local/src/zabbix-2.4.7/libiconv-1.14/srclib‘ make[1]: *** [all] Error 2 make[1]: Leaving directory `/usr/local/src/zabbix-2.4.7/libiconv-1.14/srclib‘ make: *** [all] Error 2
解决办法:
vi libiconv-1.14/srclib/stdio.in.h
将698行的代码:_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
本文出自 “小菜鸟” 博客,请务必保留此出处http://baishuchao.blog.51cto.com/12918589/1936525
编译安装libiconv报错:./stdio.h:1010:1: error: 'gets' undeclared here (not in a function)
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。