I am creating a game, and I was going to see what errors appear, and there is one that is very common and very perplexing 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 applies to the SpaceObject class and all its other findings. The Coordinate class is just a 2d vector class and, if that matters, refers only to the environment class.
The Environment class refers to SpaceObject, but I don't think the problem is (correct me if I'm wrong)
This is my first major large-scale project in C ++, and I was wondering if this could be a newbieโs common mistake with a more obvious solution. If that matters, the hierarchy of the SpaceObject classes is not completely populated, but populated by several levels outside the SpaceObject and Ship classes. .
.
.
Edit: this is in response to a comment.
-When I say a link, I mean a link to this class in another class. As in the SpaceObject class, I refer to the Coordinate class:
Coordinate * Position
The environment makes reference to SpaceObject pointers, but I donโt see that I canโt refer to such classes ... I mean that all my classes must somehow relate to eachother, right?
In response to the code insert, this is difficult because these are huge classes, but here is the line the error points to:
public: Ship(Coordinate * positionObject_, int direction_, int possibleDirections_, int maxHealth_, Component * objectSectors_, int numOfObjectSectors_, double speed_);