In the A.hpp file, I have a structure that has a pointer to class B
struct state
{
B *b;
};
In the A.hpp file, I added the ad ahead, and I included the B.hpp file in the A.cpp file
class B
In a B.hpp file, a function uses the state that A.hpp declared as an argument to the function.
bool function_in_b(state *s)
I also added the declaration of A in the B.hpp file and added the header file A, A.hpp in the B.cpp file.
//B.hpp
class A
All header files have header protection. If I try to compile, it will not find the "state" declared in A.hpp. Thus, he will not find a matching function and complains that the candidates
bool function_in_b(int *)
How to fix this problem?
Thanks in advance
source
share