0

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.

hrr4
  • 3
  • 2

1 Answers1

0

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

Sach
  • 659
  • 8
  • 20
  • It seems I did have a namespace issue! I have a header file that is strictly for common includes and put it in there thinking it'd work. But once I moved the RapidXML include to the class header it worked fine. Thanks. – hrr4 Aug 29 '12 at 14:49