原文地址::https://blog.csdn.net/sinat_35706094/article/details/88182896
相关文章
1、Linux 编码转换 (iconv失败的解决方法)----https://blog.csdn.net/violet089/article/details/51568667
2、ARM开发板上iconv_open("utf-8", "gb2312") 调用失败的解决方法----https://blog.csdn.net/love_life2011/article/details/7086910#comments
3、linux下c语言利用iconv函数实现utf-8转unicode----https://www.cnblogs.com/etangyushan/p/3753847.html
4、交叉编译opencv报错:/usr/local/lib/libz.so: file not recognized: File format not recognized----https://blog.csdn.net/qingzhuyuxian/article/details/86588953
5、libiconv字符集转换库使用方法----https://blog.csdn.net/ying_593254979/article/details/12133391
6、使用gnu工具链自带iconv完成gbk/gb2312到unicode字符编码双向转换----https://whycan.cn/t_1023.html
一、环境
虚拟机:ubuntu-16.04
iconv版本:libiconv-1.14.tar.gz下载地址:http://download.csdn.net/detail/shanleichicheng/4538600
交叉编译工具:
二、编译安装
1、./configure --prefix=/usr/local/libiconv_amba_install/ --host=armv7l-timesys-linux-gnueabi- CC=/home/iflytek-dyye/toolchain/bin/armv7l-timesys-linux-gnueabi-gcc CXX=/home/iflytek-dyye/toolchain/bin/armv7l-timesys-linux-gnueabi-g++ --enable-shared --enable-static
2、make
注意:
报错, error: ‘gets’ undeclared here (not in a function);
解决办法:vi srclib/stdio.in.h,
搜索
_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
3、sudo make install
注意:
报错:armv7l-timesys-linux-gnueabi-ranlib command not found
解决方法:切换到管理员权限,sudo su,将交叉编译工具链地址加到~/.bashrc文件最后面
export PATH=/home/iflytek-dyye/toolchain/bin:$PATH
保存退出,重启系统,再进入当前目录下,sudo su进入管理员权限,再make install即可完成安装。
4、最后在prefix指定的目录下会生成相应工具和库。
三、参考
https://www.cnblogs.com/grimm/p/5663863.html
https://blog.csdn.net/wuyu92877/article/details/52472810
https://blog.csdn.net/yuan1125/article/details/51064680
https://blog.csdn.net/qq_22790049/article/details/52806954
https://blog.csdn.net/qq_22716879/article/details/51915981
https://blog.csdn.net/geekcome/article/details/6705418
https://blog.csdn.net/zhanglpql/article/details/14122209
————————————————
版权声明:本文为CSDN博主「小小笨小孩」的原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/sinat_35706094/article/details/88182896