Solver.h:26: error: expected `)' before '&' token
Solver.h:30: error: ISO C++ forbids declaration of `PuzzleRules' with no type
Solver.h:30: error: expected `;' before '*' token
I think i might be able to get around the first problem by just passing the solver a reference at construction and removing '&' in the header file prototype. The second problem on line 30 i am less sure of and I'm hoping someone can point me in the right direction.
I find that this system of including files works wonders;
main.hpp, yes i know it's the header for main, but this way all your cpp files include it (main.cpp for example), and this includes all your headers. You'll never have linking errors again, however you may need to order your include for dependency issues.
example from one of my games for the console showing my preferred including method;
@theexactpoint: You probably don't need the include at all. Just forward declare (class PuzzleRules; at the beginning)
Ignatus wrote:
however you may need to order your include for dependency issues.
That should not happen (it even bothers have to maintain the linking order, like in SFML). Please read this http://www.cplusplus.com/forum/articles/10627/#msg49680
However I remember something about having to include cstdlib before GLUT (probably a bug)
but this way all your cpp files include it
So you end including unnecessaries* files, you will be recompiling when you shouldn't and the process of the files takes time.
Also don't using on headers (especially before includes) it defeats the purpose of having namespace