linux交叉编译libiconv

1.解压libiconv-1.14.tar

2.进入解压后目录libiconv-1.14

3.执行交叉编译环境命令,例如:

source /home/huhe/environment-setup-aarch64-poky-linux

 

4.执行配置

./configure --prefix=/home/huhe/libiconv-1.14/out --host=arm-linux

 

5.执行

make
make install

 

------------------------------------------------------------------------------------------------------------------

如果编译过程中出现以下错误时

./stdio.h:1010:1: error: ‘gets’ undeclared here (not in a function); did you mean ‘fgets’?
_GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");

 

在文件libiconv-1.14\srclib\stdio.h的1010行和文件libiconv-1.14\srclib\stdio.in.h的698行添加以下代码保存后再重新编译即可

#if defined(__GLIBC__) && !defined(__UCLIBC__) && !__GLIBC_PREREQ(2, 16)
_GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");
#endif

 

posted on 2022-09-20 09:33  Ants_hu  阅读(348)  评论(0编辑  收藏  举报

导航