For simplicity, suppose I have two files, each with one namespace containing one class. One is "Aspen.h", the other "Birch.h"
Aspen.h contains:
Birch.h contains:
The problem:
When I compile "Aspen.cc" (not shown), the header "Aspen.h" includes "Birch.h". "Birch.h" has a private variable named m_data of type Aspen::Alpha*. However, the compiler (gcc 3.4) gives me the following errors:
But the file I'm compiling contains the namespace Aspen, so I have no clue to why it doesn't recognize Aspen.
Any remedies?
Thanks!
EDIT: sorry about the spacing. ATOT removes them.
Aspen.h contains:
#ifndef H_ASPEN
#define H_ASPEN
#include "Birch.h"
namespace Aspen {
class Alpha {
public:
void FunctionFoo(Birch::Beta*);
};
};
#endif
Birch.h contains:
#ifndef H_BIRCH
#define H_BIRCH
#include "Aspen.h"
namespace Birch {
class Beta {
public:
FunctionBar(int);
private:
Aspen::Alpha* m_data;
};
};
#endif
The problem:
When I compile "Aspen.cc" (not shown), the header "Aspen.h" includes "Birch.h". "Birch.h" has a private variable named m_data of type Aspen::Alpha*. However, the compiler (gcc 3.4) gives me the following errors:
In file included from Aspen.h:4:
Birch.h:11: error: `Aspen' has not been declared
But the file I'm compiling contains the namespace Aspen, so I have no clue to why it doesn't recognize Aspen.
Any remedies?
Thanks!
EDIT: sorry about the spacing. ATOT removes them.