TinyXMl文件操作代码编译报错
一个代码,是修改xml文件中节点属性name的值为1,可是编译报错 请问下该怎么解决呢?
XML修改器.cpp(17): error C2440: “初始化”: 无法从“const wchar_t [14]”转换为“std::basic_string<_Elem,_Traits,_Ax>”
XML修改器.cpp(20): error C2039: “map”: 不是“std”的成员
1>XML修改器.cpp(20): error C2065: “map”: 未声明的标识符
1>XML修改器.cpp(20): error C2275: “std::string”: 将此类型用作表达式非法
1>XML修改器.cpp(20): error C2065: “AttMap”: 未声明的标识符
1>XML修改器.cpp(20): error C2275: “std::string”: 将此类型用作表达式非法
1>XML修改器.cpp(21): error C2065: “AttMap”: 未声明的标识符
1>XML修改器.cpp(21): error C2228: “.insert”的左边必须有类/结构/联合
1> 类型是“'unknown-type'”
1>XML修改器.cpp(22): error C2065: “AttMap”: 未声明的标识符
1>XML修改器.cpp(22): error C3861: “ModifyNode_Attribute”: 找不到标识符
#include "stdafx.h"
#include <iostream>
#include "tinyxml.h"
#include "tinystr.h"
#include <string>
using namespace std;
#pragma comment(lib, "tinyxml_STL.lib")
int _tmain(void)
{
std::string XmlFile = _T("C:\\Demo1.xml");
std::string strNodeName = _T("student");
typedef std::pair <std::string,std::string> String_Pair;
std::map<std::string,std::string> AttMap;
AttMap.insert(String_Pair(_T("name"),_T("1")));
ModifyNode_Attribute(XmlFile,strNodeName,AttMap);
return 0;
}
...全文
相关推荐
tinyxml在linux下动态库的使用示例代码
tinyxml在linux下动态库的使用示例代码
tinyxml2+示例代码+介绍文档
资源包含2015.9.23从官网下载的tinyxml2的源码和自己编写的示例代码还有介绍文档,容易上手。官网的示例代码和文档晦涩难懂,才自己整理。
tinyxml编译好的
tinyxml是解析xml非常方便的开发源码,适用于C++xml协议格式方面的开发。
在vs2015中编译好的tinyxml包
在vs2015中编译好的tinyxml包,里面包含release x86与x64的lib,include与其他cpp文件
已编译好的tinyxml2库.rar
使用时包含tinyxml2.h、tinyxml2.cpp即可,也可调用动态库~


