Hello.
I am having some desperate problems with namespaces.
Lets say that I have one file, file1.h. In that file, I define something like this:
namespace A
{
int variable;
class C
{
C(int var) {}
...
};
};
File1.cpp:
...
Now I have another file, file2.cpp:
#include "file1.h"
void SomeFunc()
{
C mynewclass(A::variable);
}
This generates a linker error:
file1.obj : error LNK2005: "int A::variable" (?...) already defined in file2.obj. I have inclusion guards set up and everything. What is going on?
Thanks.