惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

S
Securelist
量子位
博客园_首页
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
The Cloudflare Blog
Hugging Face - Blog
Hugging Face - Blog
S
SegmentFault 最新的问题
IT之家
IT之家
博客园 - 聂微东
V
V2EX
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
云风的 BLOG
云风的 BLOG
aimingoo的专栏
aimingoo的专栏
S
Secure Thoughts
酷 壳 – CoolShell
酷 壳 – CoolShell
Stack Overflow Blog
Stack Overflow Blog
The Hacker News
The Hacker News
S
Schneier on Security
The GitHub Blog
The GitHub Blog
T
Tenable Blog
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
美团技术团队
D
DataBreaches.Net
C
CERT Recently Published Vulnerability Notes
Hacker News - Newest:
Hacker News - Newest: "LLM"
D
Docker
V
Vulnerabilities – Threatpost
Recent Commits to openclaw:main
Recent Commits to openclaw:main
博客园 - 【当耐特】
The Register - Security
The Register - Security
博客园 - 叶小钗
Jina AI
Jina AI
MongoDB | Blog
MongoDB | Blog
H
Heimdal Security Blog
小众软件
小众软件
PCI Perspectives
PCI Perspectives
Spread Privacy
Spread Privacy
Help Net Security
Help Net Security
TaoSecurity Blog
TaoSecurity Blog
L
Lohrmann on Cybersecurity
A
About on SuperTechFans
S
Security Affairs
C
Cybersecurity and Infrastructure Security Agency CISA
Apple Machine Learning Research
Apple Machine Learning Research
Know Your Adversary
Know Your Adversary
Schneier on Security
Schneier on Security
www.infosecurity-magazine.com
www.infosecurity-magazine.com
WordPress大学
WordPress大学
Simon Willison's Weblog
Simon Willison's Weblog

博客园 - 子风

Android相关转载帖子 c++ 函数的工作原理 C和C++的存储模式 VS2005配置开发ARM c++ 虚析构函数的思考 (转)Eclipse代码提示功能设置(Java & C/C++) linux下面eclipse的c++配置 VS2008 配置boost 用VS.NET2008打包程序遇到不可恢复的生成错误的解决方案 推荐一个原型的设计软件 Mockups For Desktop Grid++Report——推模式下填充子报表 c# 对象的创建过程 Failure sending mail - 子风 XP下IIS错误:Server Application Error css总结 asp.net缓存-数据依赖缓存 - 子风 - 博客园 .net 测试工具 .net 发送Email 利用7z来分卷压缩文件
arm-linux-g++ 下交叉编译libxml2
子风 · 2011-12-06 · via 博客园 - 子风

来自: http://blog.csdn.net/expleeve/article/details/6037219

由于XML在数据存储方面的优势,使得使用xml作为配置文件,是一种常用的手段。

libxml2是一个xml c语言版的解析器,本来是为Gnome项目开发的工具,是一个基于MIT License的免费开源软件。它除了支持c语言版以外,还支持c++、PHP、Pascal、Ruby、Tcl等语言的绑定,能在Windows、Linux、Solaris、MacOsX等平台上运行。功能还是相当强大的,相信满足一般用户需求没有任何问题。

最近在arm-linux平台上需要用到libxml2库,这里做一个记录。

首先,从libxml2官网上下载相关软件包,我用的是libxml2-sources-2.7.8.tar.gz 。

1、  解压后,./configure –host=arm-linux

2、 make  

3、 make install

这样就生成了arm下的共享库文件(.so)和静态链接库文件(.a),默认存放在/usr/lib下面(当然与你本机的环境变量有关)

在进行编译时,可以使用如下命令

mipsel-linux-gcc  -o targetfile sourcefile.c -I /usr/local/include/libxml2/ -L /usr/local/lib  -lxml2

通过file命令,可以看到目标程序的类型

ELF 32-bit LSB executable, MIPS, MIPS64 version 1 (SYSV), dynamically linked (uses shared libs), not stripped

这样就得到目标程序。

       把这个程序放到arm平台的开发板上,然后把libxml2.so.2放在开发板的/lib或者/usr/lib目录下,即可在开发板上正常运行目标程序。

学习,积累中......