windows环境下,怎样调用libxml2(vs2003)
我的步骤是:
1\下载libxml2-2.6.32+.win32.zip
2\下载iconv-1.9.2.win32
3\新建一个工程:
#include "stdafx.h"
#include <stdio.h>
#include <libxml\parser.h>
#include <iconv.h>
void _tmain(int argc, _TCHAR* argv[])
{
xmlDocPtr doc;
xmlNodePtr cur;
doc = xmlParseFile("F:\\work\\xme_demo\\xme_demo\\EKA1.xml");
if (doc == NULL )
{
fprintf(stderr,"Document not parsed successfully. \n");
return;
}
cur = xmlDocGetRootElement(doc);
if (cur == NULL)
{
fprintf(stderr,"empty document\n");
xmlFreeDoc(doc);
return;
}
if (xmlStrcmp(cur->name, (const xmlChar *) "story"))
{
fprintf(stderr,"document of the wrong type, root node != story");
xmlFreeDoc(doc);
return;
}
return ;
}
4\将头文件路径添加到工程中(属性-配置-c/c++-常规).
5\将lib添加到工程中(属性-配置-链接器-输入)
编译正确,执行出现弹出"无法找到组件"窗口,提示"没有找到LIBXML2.dll,因此这个应用程序未能启动.重新安装……";
想请教各位高人,这是哪出了问题?是不是下载的libxml2-2.6.32+.win32.zip存在问题?