Hey All,

I've been stumbling into the same (annoying little) problem a couple of times, and I'd like to find out how to fix it properly.

Pseudo code

// file A.hpp
#include "classB.hpp"
class A { A() };

// file A.cpp
A::A() { }
// file B.hpp
#include "classA.hpp"
class B { B() };

// file B.cpp
B::B() { }

Notice how they're basically two normal classes, except that the both include the other.
I do have #ifndef CLASS_A / CLASS_B in the headers (header gaurds).

If i do #include "classA.hpp" in file classB.cpp I get errors like so:
error: ‘A’ was not declared in this scope

If I do a dummy class class B; then I can't use any of the functions in that class, because it complains that the class doesn't have that functionality.

Help apprecicatied, as I'm not sure how to design for such a situation... :)

i hope this could be helpful

#include <iostream>
using namespace std;

class A;

class B{
	A *obj;
public :
	~B(){if(obj)delete obj;}
	void helloFromA();
class A{
public :
	void hello()
		cout<<"hello from A"<<endl;

void B::helloFromA()
		obj=new A();;