What could possibly cause this error when declaring an object inside a class?

My first guess would be that the definition of Grid simply isn't visible at the point that you've tried to use it in Ocean Typically this happens if you have each in its own file, and haven't used a header to allow each to be "seen" by the other.

My first guess would be that the definition of Grid simply isn't visible at the point that you've tried to use it in Ocean. Typically this happens if you have each in its own file, and haven't used a header to allow each to be "seen" by the other.

I clarified that in my post, I did include the definition of Grid the The Ocean. Thanks – m4design May 22 '10 at 6:28.

We need the rest of the source, but there are a couple of possible answers: Grid is being overloaded by something via a macro (#define) the Grid class definition isn't being included.

In order for Grid to be used in your other class you either need to include the header of the Grid in the header or do a forward declaration of the class and declare it as a pointer in your class then instantiate it in your . Cpp file. Class Grid; class Ocean { Grid* grid; }; or preferably : class Ocean { boost::shared_ptr grid; }.

1 I think it should be boost:: not boost: – Delan Azabani May 22 '10 at 6:32 oops, yes. Edited, thanks – Anders K. May 22 '10 at 7:08.

I've got two classes: Ocean and Grid. Can you possibly predict what produces this error with the limited info I provided? It seems that as if the Ocean doesn't like the Grid class.

Could this be because of the poor implementation of the grid class. BTW the Grid has a default constructor. Yet the error happens in compiling time!.

EDIT: They're each in separate header file, and I've included the Grid. H in the Ocean.h.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions