今天搭建環境的時候,出現了'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
./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、編譯,通過!!!!
非常感謝網友的幫助。