I\'ve approached this strange ( for me ) effect in VS 2010. Can anyone smart shed some light on it please.
//Header.h
#include
namespace MySpa
The whole point of namespaces is that names in a particular namespace are independent of names outside that namespace. A program could have both a MySpace::SOME_CONST_STRING
and a global ::SOME_CONST_STRING
, and these are two completely unrelated symbols. It would be wrong for the linker to use a definition of one to satisfy a reference to the other.
When you define a variable, you have to define it in the namespace where you want it to be.