https://www.cnblogs.com/yangy1989/p/6197087.html 1:下载libxml2源码包 http:/// --download FTP 准备工作: 1、libxml2软件版本:libxml2-2.9.9.tar.gz 2、交叉编译工具链:arm-none-linux-guneabi 软件安装: 1、设置环境变量: export PATH=/arm-none-linux-gnueabi/bin:$PATH (注释: 此处变量为交叉编译工具解压的路径) 2、解压: tar xvf libxml2-2.6.32.tar.gz 3、进入解压文件目录:cd libxml2-2.6.32/ 4、配置:./configure --host=arm-linux --target=arm-linux CC=arm-linux-gnueabihf-gcc AR=arm-linux-gnueabihf-ar LD=arm-linux-gnueabihf-ld ANLIB=arm-linux-gnueabihf-ranlib --without-zlib --without-python --prefix=/home/xpf/code/lxml2 加粗部分是因为:https://blog.csdn.net/c1194758555/article/details/73888960 编译libxml2是遇到错误提示“libxml.c:14:20: fatal error: Python.h: No such file or directory”: apt-get install python-dev 5、编译:make 6、安装:sudo make install 安装完成后,安装在/opt/libxml2/libxml目录中。交叉编译需要的头文件和库文件。(可通过:readelf -h filename 查看是否编译为arm版) 7、移植:将pc上的 /opt/libxml2/libxml/lib/目录下的libxml2.so.2放在开发板的/lib或者/usr/lib目录下.移植完成。 |
|