Hi, could someone help me figure out where the bug is in this code snippet? Compiler error is: 'A::type has not been declared". Below are the four files that should be relevant; the weird thing is that I have another example in my code that does almost the exact same thing but compiles just fine. The only difference between that example and this one is that the file dependencies are different; A does not need to call one of B's methods in the other example but it does in this one. Not sure if that's the reason.
Anyways, the code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
#ifndef A_H
#define A_H
//classA.h
#include "classB.h"
class A
{
public:
enum type{type1, type2};
type TYPE = type1;
B* b;
void callBfunc();
}
#endif //A_H