linux eclipse libxml导入和使用
一、libxml2的安装
下载最新的libxml2库
http://xmlsoft.org/downloads.html。
具体安装步骤:
1、解压:tar zxvf libxml2-2.9.1.tar.gz
2、进入解压后的安装目录:cd libxml2-2.9.1
3、安装:
1 ./configure
2 make
3 make install
二、eclipse中添加libxml2库
于是经过我的尝试,我终于在ubuntu下完成了eclipse中配置libxml2的探索
使用xml2-config --cflags
和xml2-config --libs
libxml2的头文件路径以及库路径和库名
eclipse 打开Project -> Properties->C/C++ General->Paths and Symbols
选择右边的includes中的GNU C,点击右边的Add,添加xml2-config --cflags的输出,比如我这里是
/usr/include/libxml2