将类成员存储为RapidXML数据类型
Storing class members as RapidXML data types
我在存储RapidXML数据类型的成员变量时遇到问题。我在成员函数的返回类型方面也遇到了这个问题。
只有在类的文件头中我才遇到这个问题。在函数中使用这些数据类型不会产生任何问题。
class Level
{
public:
//Level();
//~Level();
sf::Sprite Update(Camera& _currentView);
char* ReadFile(std::string& _level);
xml_node<>* ParseFile(std::string _level, std::string _tileset);
void BuildLayers(xml_node<>* _fileNode);
void BuildClips();
void BuildPositions();
private:
int tileWidth, tileHeight;
int totalWidth, totalHeight;
std::string tilesetSource;
sf::Texture tilesetTexture;
int tilesetImageWidth, tilesetImageHeight;
//int tilesetWidth, tilesetHeight;
std::vector<std::vector<Tile*>> tilesVector;
//std::vector<Tile*> tileVector;
};
这让我产生了这样的错误:
error C2143: syntax error : missing ';' before '<'
error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
error C2238: unexpected token(s) preceding ';' enter code here
我已经尝试搜索与此问题相关的任何内容,但没有找到任何内容。因此,我们非常感谢您的帮助。
这看起来像是一个命名空间问题。添加using namespace rapid_xml
或将xml_node
替换为rapid_xml::xml_node
。
相关文章:
- 防止主数据类型C++的隐式转换
- 处理小于cpu数据总线的数据类型.(c++转换为机器代码)
- 在C++中打印指向不同基元数据类型的指针的内存地址
- C++浮点数据类型和字符串数据类型无法子到模板函数中
- 如何计算数据类型的范围,例如int
- C++中数据类型修饰符的顺序
- C++LinkedList问题.数据类型之间存在冲突?没有匹配的构造函数
- 特定数据类型的模板类
- 具有多个模板的模板函数,用于特定数据类型(如字符串)?
- 有没有办法提示用户使用哪种数据类型作为模板 c++
- int数据类型的指针指向的是什么,如果是一个类的私有数据成员,我们创建了该类的两个对象?
- 时间复杂度 当具有复合数据类型(如元组或对)时?
- 如何获取C++字符数据类型的地址
- 将复杂的非基元C++数据类型转换为 Erlang/Elixir 格式,以使用 NIF 导出方法
- 构造智能点数据类型以及普通数据类型的通用方法
- 如何使映射键具有两种不同的数据类型?
- 数据类型"struct seq<0, 1, 2>{}"含义是什么?
- 如何在不破坏现有应用程序的情况下更改 API 中 stl 容器的数据类型?
- Static_cast转换为错误的数据类型,但结果仍然正确?
- 将类成员存储为RapidXML数据类型