美文网首页
[配置] VS2005_C++_TinyXml2

[配置] VS2005_C++_TinyXml2

作者: CrazyTiger | 来源:发表于2018-03-15 10:26 被阅读0次

参考资料

C++使用TinyXml2解析Xml

下载地址

官网
http://www.grinninglizard.com/tinyxml/index.html
TinyXML
https://www.sourceforge.net/projects/tinyxml/?source=typ_redirect
TinyXML2(效率更高,就选它了)
https://github.com/leethomason/tinyxml2

安装配置

  1. 把tinyxml2.h和tinyxml2.cpp两个文件,拷贝到项目源码文件夹。
  2. 在项目中添加这两个文件,分别放到Header Files和Source Files目录下。
  3. 在使用xml的文件中,引入头文件和命名空间。一些函数命名会与微软的xml库冲突,使用tinyxml2::xxx来调用方法和类型就好了。
    #include "tinyxml2.h"
    using namespace tinyxml2;
    

编译报错

"stdint.h": No such file or directory”

这个问题在JsonCpp中也遇到了,同样的解决方法。
将 config.h中的#include<stdint.h>注释掉,手动添加typedef int64t, uint64t,如下:

// @ file: config.h
//#include <stdint.h> //typedef int64_t, uint64_t
typedef long long int64_t;
typedef unsigned long long uint64_t;

相关文章

网友评论

      本文标题:[配置] VS2005_C++_TinyXml2

      本文链接:https://www.haomeiwen.com/subject/qijqqftx.html