Possible Duplicate:
Why does const imply internal linkage in C++, when it doesn’t in C?
If I have the following:
a.cpp:
const int ArrayOfInts[] = {1, 2, 3, 4, 5};
b.cpp:
extern const int ArrayOfInts[];
void SomeFunc()
{
int a = ArrayOfInts[0];
}
The linker complains that ArrayOfInts is unresolved from b.obj. Removing the const qualifier makes the link succeed. Any ideas why this fails?
Thanks.