Compile libiconv in CentOS 7
Compile and install libiconv
Cd/usr/local/src
Wgethttp: // ftp.gnu.org/pub/gnu/libiconv/libiconv-1.14.tar.gz
Tar xfz libiconv-1.14.tar.gz
Cd libiconv-1.14
./Configure -- prefix =/usr/local/libiconv
Make
Make install
Cd ..
Make errors:
Gcc-DHAVE_CONFIG_H-DEXEEXT = \ "\"-I. -I .. -I .. /lib-I .. /intl-DDEPENDS_ON_LIBICONV = 1-DDEPENDS_ON_LIBINTL = 1-g-O2-c allocator. c
Gcc-DHAVE_CONFIG_H-DEXEEXT = \ "\"-I. -I .. -I .. /lib-I .. /intl-DDEPENDS_ON_LIBICONV = 1-DDEPENDS_ON_LIBINTL = 1-g-O2-c areadlink. c
Gcc-DHAVE_CONFIG_H-DEXEEXT = \ "\"-I. -I .. -I .. /lib-I .. /intl-DDEPENDS_ON_LIBICONV = 1-DDEPENDS_ON_LIBINTL = 1-g-O2-c careadlinkat. c
Gcc-DHAVE_CONFIG_H-DEXEEXT = \ "\"-I. -I .. -I .. /lib-I .. /intl-DDEPENDS_ON_LIBICONV = 1-DDEPENDS_ON_LIBINTL = 1-g-O2-c malloca. c
Gcc-DHAVE_CONFIG_H-DEXEEXT = \ "\"-I. -I .. -I .. /lib-I .. /intl-DDEPENDS_ON_LIBICONV = 1-DDEPENDS_ON_LIBINTL = 1-g-O2-c progname. c
In file encoded ded from progname. c: 26: 0:
./Stdio. h: 1010: 1: Error: 'gets' is not declared (not in the function)
_ GL_WARN_ON_USE (gets, "gets is a security hole-use fgets instead ");
^
Ke [2]: *** [progname. o] Error 1
Mongoake [2]: leaves the directory "/usr/local/src/libiconv-1.14/srclib"
Make [1]: *** [all] Error 2
Make [1]: Leave the directory "/usr/local/src/libiconv-1.14/srclib"
Make: *** [all] Error 2
Solution 1:
Edit the stdio. h file and change the content of the _ GL_WARN_ON_USE (gets, "gets is a security hole-use fgets instead") field to the following:
# Ifdefined (_ GLIBC __)&&! Defined (_ UCLIBC __)&&! _ GLIBC_PREREQ (2, 16)
_ GL_WARN_ON_USE (gets, "gets is a security hole-use fgets instead ");
# Endif
# Endif
Solution 2:
Cd srclib/
Sed-ir-e '/gets is a security/D'./stdio. in. h
Cd ../
Make
Make again!