These two declarations are contradictory:
const extern int foo;
int foo = 42;
The first declares it fooas const, and the second declares it as not const.
Error messages:
prog.cpp:4:5: error: conflicting declaration
‘int foo’ int foo = 42;
^~~
prog.cpp:3:18: note: previous declaration as ‘const int foo’
const extern int foo;
^~~