天天看點

centos安裝nginx 編譯時報錯_CentOS7下安裝libiconv時報錯‘gets undeclared here (not in a function)的...

編譯安裝時出現下列錯誤,導緻編譯不通過。

./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”);

centos安裝nginx 編譯時報錯_CentOS7下安裝libiconv時報錯‘gets undeclared here (not in a function)的...

解決方法:

修改srclib/stdio.in.h,将_GL_WARN_ON_USE (gets, “gets is a security hole – use fgets instead”);修改為下列内容,大概在698行。

#if defined(__GLIBC__) && !defined(__UCLIBC__) && !__GLIBC_PREREQ(2, 16)

_GL_WARN_ON_USE (gets, “gets is a security hole – use fgets instead”);

#endif

修改前如下:

centos安裝nginx 編譯時報錯_CentOS7下安裝libiconv時報錯‘gets undeclared here (not in a function)的...

修改後如下:

centos安裝nginx 編譯時報錯_CentOS7下安裝libiconv時報錯‘gets undeclared here (not in a function)的...

重新configure,再make,通過。