V
vsgdp
I have a few variables that need to be global, but they are related and I
thought it be cleaner to put them in a namespace:
namespace x
{
A* a;
B b;
C c;
}
Several modules need access to this namespace, but I am getting a linker
error
"already defined in whatever.obj"
This is similar to what happens if I used plain globals, but that is easily
fixed by using extern and initializing the globals in one implementation
file. I tried to do something similar here but it didn't work. Any
solutions?
thought it be cleaner to put them in a namespace:
namespace x
{
A* a;
B b;
C c;
}
Several modules need access to this namespace, but I am getting a linker
error
"already defined in whatever.obj"
This is similar to what happens if I used plain globals, but that is easily
fixed by using extern and initializing the globals in one implementation
file. I tried to do something similar here but it didn't work. Any
solutions?