Skip to main content
AI Assist is now on Stack Overflow. Start a chat to get instant answers from across the network. Sign up to save and share your chats.

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

3
  • 2
    @Iiya Melamed I recommend that you make a new question for that. But as a hint - try to not depend on the definition of class Bear in "board.H". For example a "Bear*" doesn't need the definition of class "Bear", but only a forward declaration like "class Bear;". Then you don't need to include the "bear.H" header. Same goes for "void f(Bear b);" (but not "void f(Bear b) { }") and "Bear&". Commented May 27, 2011 at 16:28
  • Compiler directives. By wrapping your classes with the #ifndef, #define, #endif directives found at the following address, the compiler should only try to compile each class once: cprogramming.com/reference/preprocessor/ifndef.html Commented May 27, 2011 at 16:31
  • I love how circular dependency error messages like this are so ambiguous. Commented May 27, 2011 at 17:24