1.tar -zxvf libiconv-1.14.tar.gz
2.cd libiconv-1.14
3.mkdir output
4.使用自己需要的交叉编译工具链
./configure --host=arm-augentix-linux-gnueabi CC=arm-augentix-linux-gnueabi-gcc CXX=arm-augentix-linux-gnueabi-g++ --prefix=$PWD/output/ --enable-static
5.make && make install
如果编译报以下错误:
In file included from progname.c:26:0:
./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”);
^
make[2]: *** [progname.o] Error 1
make[2]: Leaving directory /usr/local/src/zabbix-2.4.7/libiconv-1.14/srclib' make[1]: *** [all] Error 2 make[1]: Leaving directory
/usr/local/src/zabbix-2.4.7/libiconv-1.14/srclib’
make: *** [all] Error 2
解决办法:
1.vi libiconv-1.14/srclib/stdio.in.h
2.将698行的代码:_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