Too many types in declaration on Class declaration.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Fr33dan
    New Member
    • Oct 2008
    • 57

    Too many types in declaration on Class declaration.

    I'm a long time Java guy trying to move to C++ but I keep getting this error that I can't seem to figure out. It must be something simple I'm missing but I can't find it by looking at examples.

    I get a "Too many types in declaration" on my class declaration line:
    Code:
    #include<string>
    #include<vector>
    #include"MapCoordinates.h"
    
    class TopographicalMap //Error: Too many types in declaration
    {
    	private:
    	double getVarience(MapCoordinates*);
    	std::vector<int> splitString(std::string*);
    	std::vector< std::vector<int> > mapData;
    	int mapWidth;
    	int mapHeight;
    
    	public:
    	TopographicalMap(std::string);
    	MapCoordinates getBestLocation(int, int);
    
    };
    I found this but his problem seemed to be the semicolon which I've added.

    I'm using Borland 5.5
  • Oralloy
    Recognized Expert Contributor
    • Jun 2010
    • 988

    #2
    Fr33dan,

    It looks like you might have a missing semicolon in the file "MapCoordinates .h".

    Did you check that?

    Comment

    • Fr33dan
      New Member
      • Oct 2008
      • 57

      #3
      I didn't even consider that since there were no flags on that file but that was the answer. I knew it was something simple. Thank you.

      Comment

      • Oralloy
        Recognized Expert Contributor
        • Jun 2010
        • 988

        #4
        You're quite welcome. Please flag the post, so others can see what the resoution was.

        Comment

        Working...