T
tech
Hi, i have the following problem
In file1.h
namespace A
{
class Bar
{
void foo();
};
}
In file2.h
class Bar;
class User
{
Bar* pBar;
};
In file2.cpp
#include "file2.h"
#include "file1.h"
User::func()
{
pBar = new Bar;
pBar->foo(); // linker error here
}
If i try to forward declare in file2.h like this
class A::Bar i get a compiler error saying that A is not a class or
namespace
with MSVC++8.
How to solve this issue.
In file1.h
namespace A
{
class Bar
{
void foo();
};
}
In file2.h
class Bar;
class User
{
Bar* pBar;
};
In file2.cpp
#include "file2.h"
#include "file1.h"
User::func()
{
pBar = new Bar;
pBar->foo(); // linker error here
}
If i try to forward declare in file2.h like this
class A::Bar i get a compiler error saying that A is not a class or
namespace
with MSVC++8.
How to solve this issue.