I'm building a game and I was compiling seeing what sort of errors were coming up and there is one there is very common and very puzzling to me:
1>c:\users\owner\desktop\bosconian\code\bosconian\ship.h(9) : error C2460: 'Ship::Coordinate' : uses 'Ship', which is being defined
This also comes up for the SpaceObject class and all other derivations of it. The Coordinate class is simply just a 2d vector class and, if it matters, references nothing but an Environment class.
The Environment class references the SpaceObject's but I don't believe that's a problem (correct me if I'm wrong)
This is my first larger scale project in C++ and I was wondering if this might be a common newbie error with a more obvious solution. If it matters the SpaceObject class hierarchy is not all the way filled in, but it is filled in several levels past the SpaceObject and Ship classes.
.
.
.
Edit: This is in response to the comment.
-When I say reference I mean refer to that class in another class. Like in the SpaceObject class I reference the Coordinate class:
Coordinate * position
Environment does make reference to SpaceObject pointers, but I can't see I could not reference classes like that...I mean, all my classes have to relate to eachother in some way, right?
In response to pasting code, it's sort of hard because they are huge classes but here is the line the error is pointing to:
public:
Ship(Coordinate * positionObject_, int direction_, int possibleDirections_, int maxHealth_, Component * objectSectors_, int numOfObjectSectors_, double speed_);//this is the line
void move();//handles the actual translation of calculated move on the map (i.e. bounds checking)