H
hepp
I have a header file that contains some constans, and the following
lines are included in it:
const int a[] = {1};
const int b[] = {2};
const int* c[] = {a, b};
My code compiles, but the linker complains about that "c" is multiple
declared. It seems to have been defined in all source files that
included this header file. Why? It only seems to be a problems when
using arrays - the following code links without any problems:
const int a = 1;
const int b = 2;
const int c = a + b;
The result is the same for all compilers I have tried (gcc and Visual
Studio).
lines are included in it:
const int a[] = {1};
const int b[] = {2};
const int* c[] = {a, b};
My code compiles, but the linker complains about that "c" is multiple
declared. It seems to have been defined in all source files that
included this header file. Why? It only seems to be a problems when
using arrays - the following code links without any problems:
const int a = 1;
const int b = 2;
const int c = a + b;
The result is the same for all compilers I have tried (gcc and Visual
Studio).