I have a namespace foo which contains an integer bar, declared so...
foo.h:
namespace foo {
int bar;
}
<
Also note that const int at namespace (global) scope in C++ has static implicitly added by default: Define constant variables in C++ header
To better understand what is going on, do a readelf on the intermediate ELF object files of the compilation, and you will see clearly is symbols are defined twice or not. Here is a detailed example: What does "static" mean in C?