Compile libiconv in CentOS 7

Source: Internet
Author: User
Tags intl

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!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.