Parse errors where syntax appears correct

Started by
4 comments, last by Zahlman 16 years, 5 months ago
This file is giving me a lot of "parse error before x token" messages when I try to compile, and I've tried isolating a lot of things to get it working again. I just had the code exactly like this before and it won't compile anymore. Cleaning the compile target didn't work either.

// file objparse.h

#ifndef OBJPARSE_H
#define OBJPARSE_H

class OBJParser: public FileParser {

    private:
        int selected;
        const char* cs;
        struct VertexStruct {
            float x, y, z;
            float t, u;
            float nx, ny, nz;
        };
        struct IndexStruct {
            int tIndices;
        };

        std::vector<VertexStruct> Vertex;

    public:
        void readVertices(std::vector<VertexStruct>&);
};

#endif

The first error is on line 6, where the class OBJParser is being declared. It says that there's a parse error before '{'. Because of this it mentions OBJParser being undefined in other places, and that there's a forward declaration of OBJParser on this file. This is the only file where the class is declared.
Electronic Meteor - My experiences with XNA and game development
Advertisement
The error could be in the header file included directly before this one.

Look in the compiler output to see which CPP file is producing the error, then look at which header is included directly before this one.
Where is FileParser defined/declared?
Quote:Original post by tidy
Where is FileParser defined/declared?

WINNAR!
I think that was it, tidy. I thought including the header file for FileParser in the file with the main function would be enough. I moved it to the OBJParser file instead.
Electronic Meteor - My experiences with XNA and game development
obligatory.

This topic is closed to new replies.

Advertisement