Examples

'gets' undeclared here (not in a function)

今天搭建环境的时候,出现了'gets' undeclared here (not in a function)问题,查了一些资料。根据http://forum.z27315.com/topic/15662-解决编译libiconv时的gets-undeclared-here错误/     的步骤,解决了问题。

我也是下载了补丁包,但是不会解压。。所有没有用这个补丁包。有会解压这个补丁的请告诉我一下。谢谢。

下面说说我是怎么解决的:

1、在命令行输入:find -name stdio.in.h。查到有两个文件中含有stdio.in.h.

./huangwork/atom-sdk/install_sdk/IntelCE-0.34.13452.340510/project_build_i686/IntelCE/autotools-0.29.12293.323798/building/m4-1.4.13/lib/stdio.in.h
./huangwork/atom-sdk/install_sdk/IntelCE-0.34.13452.340510/project_build_i686/IntelCE/bison-0.29.12232.321541/bison-2.4.2/lib/stdio.in.h
 
2、打开第一个文件中的stdio.in.h,没有找到
_GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");
打开第二个找到了。
然后
-_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

即:把第一行注释掉,所以用-表示注释,然后添加第二行和第三行。最后不要忘了添加#endif。
3、编译,通过!!!!
 
非常感谢网友的帮助。

posted on 2014-09-23 13:49  足各火丁  阅读(16319)  评论(0编辑  收藏  举报

导航

Examples