I run into an interesting issue. In my file A.cpp I have a definition
const int I = 1;
in my file B.cpp I declare
extern const int I;
and when I use it, I receive the error message when compiling
'undefined reference to I'
If I remove const
in file A, no message and compiles fine. Till now I guessed that const int
and int
have different signatures. What is going on here what I do not understand?