Question

I'm having an issue with storing member variables that are of RapidXML datatypes. I also experience this problem with member functions' return types.

Only in the class' file header to I experience this issue. Using these datatypes within functions yields no issues.

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

Which yields me such errors:

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

I've tried searching for anything related to this issue and haven't found anything. So any help is really appreciated.

Was it helpful?

Solution

it look like a namespace issue. Add using namespace rapid_xml or replace xml_node with rapid_xml::xml_node.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top