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;
}