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

推荐订阅源

N
News and Events Feed by Topic
WordPress大学
WordPress大学
Vercel News
Vercel News
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
小众软件
小众软件
L
LangChain Blog
雷峰网
雷峰网
D
DataBreaches.Net
博客园 - 三生石上(FineUI控件)
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
T
Tor Project blog
NISL@THU
NISL@THU
Scott Helme
Scott Helme
量子位
S
Security Affairs
T
Threat Research - Cisco Blogs
博客园_首页
云风的 BLOG
云风的 BLOG
D
Docker
AWS News Blog
AWS News Blog
腾讯CDC
博客园 - 聂微东
The GitHub Blog
The GitHub Blog
U
Unit 42
Recent Announcements
Recent Announcements
Apple Machine Learning Research
Apple Machine Learning Research
G
Google Developers Blog
T
The Exploit Database - CXSecurity.com
MongoDB | Blog
MongoDB | Blog
Stack Overflow Blog
Stack Overflow Blog
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
L
LINUX DO - 热门话题
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
The Last Watchdog
The Last Watchdog
C
Cybersecurity and Infrastructure Security Agency CISA
IT之家
IT之家
W
WeLiveSecurity
P
Privacy & Cybersecurity Law Blog
F
Full Disclosure
L
Lohrmann on Cybersecurity
The Hacker News
The Hacker News
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
Y
Y Combinator Blog
S
Security @ Cisco Blogs
C
Cyber Attacks, Cyber Crime and Cyber Security
C
Check Point Blog
C
CXSECURITY Database RSS Feed - CXSecurity.com
N
News and Events Feed by Topic
PCI Perspectives
PCI Perspectives
I
InfoQ

博客园 - 子风

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目录下,即可在开发板上正常运行目标程序。

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