您的位置:首页 > 其它

编译 libiconv-1.14 的时候出现 ./stdio.h:1010:1: error: 'gets' undeclared here (not in a function)

2016-07-18 18:43 615 查看
编译 libiconv-1.14 的时候提示函数未定义:

./stdio.h:1010:1: error: 'gets' undeclared here (not in a function)

cd 到 libiconv-1.14/srclib/stdio.h,打开

sudo gedit stdio.h


定位到 1010 行,发现是一个函数指针参数的宏函数:

_GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");


http://blog.csdn.net/ownfire/article/details/47276219 给出了一种解决方法。还有一种更简单的解决方法就是注释:

---1010: _GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");
+++1010: //_GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  iconv stdio gets