In such a context, the static
keywords means file scope, as in C.
Probably not what you want in a public header.
Want you want is probably extern
, in your header file:
extern const int a;
extern const int a;
It will declare two global variables.
You'll then need a definition, in some .cpp file:
const int a = 42;
const int b = 43;
About file scope, it means that the visibility of such a declaration will be limited to the file in which it is declared. The linker won't generate a public symbol for this.
So if you use this in a header file, a different declaration will be issued in each file where the header is included.