0

When I call the static method ClassA::it() in the method conn I get a compiler error.

#ifndef CLASSA
#define CLASSA

#include "ClassB.h"

namespace name {

class ClassA
{
public:
    static ClassA& it()
    {
        static ClassA c;
        return c;
    }

    [...]
};

}
#endif

-

#ifndef CLASSB
#define CLASSB

#include "ClassA.h"

namespace name {

class ClassB
{
public:
    static Handle conn()
    {
        return getHandle(ClassA::it().str());
    }
};

}

#endif

I get an compiler error which says that in the method conn() ClassA is not declared. How can I resolve this error?

user32323
  • 299
  • 1
  • 3
  • 11

0 Answers0