解决编译libiconv时报错:./stdio.h:1010:1: error: 'gets' undeclared here (not in a function)
2015-08-04 14:24
507 查看
转载自:http://forum.z27315.com/topic/15662-%E8%A7%A3%E5%86%B3%E7%BC%96%E8%AF%91libiconv%E6%97%B6%E7%9A%8439gets39-undeclared-here%E9%94%99%E8%AF%AF/
在编译libiconv时出错
./stdio.h:1010:1: error: 'gets' undeclared here (not in a function)
下面报
make[2]: *** [progname.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: Leaving directory `/opt/sources/libiconv-1.14/srclib'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/opt/sources/libiconv-1.14/srclib'
make: *** [all] Error 2
Google搜了好久终于找到一篇文章《libiconv gets undeclared》真是雪中送炭啊。
俺运行patch后好久都没有反应 :( 最后人肉修改
这个补丁的内容如下
在编译libiconv时出错
./stdio.h:1010:1: error: 'gets' undeclared here (not in a function)
下面报
make[2]: *** [progname.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: Leaving directory `/opt/sources/libiconv-1.14/srclib'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/opt/sources/libiconv-1.14/srclib'
make: *** [all] Error 2
Google搜了好久终于找到一篇文章《libiconv gets undeclared》真是雪中送炭啊。
wget -c http://www.itkb.ro/userfiles/file/libiconv-glibc-2.16.patch.gz cd libiconv-1.14/srclib patch -p1 stdio.in.h
俺运行patch后好久都没有反应 :( 最后人肉修改
这个补丁的内容如下
--- srclib/stdio.in.h.orig 2011-08-07 16:42:06.000000000 +0300 +++ srclib/stdio.in.h 2013-01-10 15:53:03.000000000 +0200 @@ -695,7 +695,9 @@ /* It is very rare that the developer ever has full control of stdin, so any use of gets warrants an unconditional warning. Assume it is always declared, since it is required by C89. */ -_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 #endif
相关文章推荐
- 禁止右键js
- HDOJ Osu! 5078【2014鞍山区域赛I题-水】
- ViewSwitcher用法浅析
- 安装JDK出现问题 Error opening registry key'software\Javasoft\Java Runtime Environment'
- JAVAweb 学习总结
- mysql表分区
- ext的相关
- 如何快速的将pdf转换成txt格式
- Shell脚本中执行mysql语句
- 总结Android Studio导入项目的几种方法
- springMVC学习笔记---修改配置文件路径和传递数据
- 序列化和模型绑定
- 利用Linux系统函数alarm() 来检测计算机性能
- java虚拟机(一)——内存管理机制与OOM异常
- HTML教程XHTML教程:HTML标记嵌套使用技巧
- UITableView中的headerView改变颜色
- Python中逐行读取文件内容的办法
- 深入探讨在集群环境中使用 EhCache 缓存系统
- Linux信号列表
- 非常详细GC学习笔记