internal linkage for const in C++?
<p>Could someone please advise?
If const in C++ defaults to internal linkage, why I get multiple definition errors in the code below?</p>

<pre><code>File : dem.h
-------------
#ifndef _DEM_H_
#define _DEM_H_

class Dem {
        public:
                static const int i;
};

const int Dem::i = 10;

#endif

    File imp1.cpp
    -------------
#include "dem.h"
#include &lt;iostream&gt;

using namespace std;

extern int foo();

int main() {
        cout &lt;&lt; foo() &lt;&lt; endl;
}

    File imp2.cpp
    -------------

~#include "dem.h"

int foo() {
        return Dem::i ;
}
</code></pre>

<p>$ g++ imp1.cpp imp2.cpp
/tmp/ccmGt0OY.o:imp2.cpp:(.rdata+0x0): multiple definition of `Dem::i'
/tmp/cc5sN7dz.o:imp1.cpp:(.rdata+0x0): first defined here
collect2: ld returned 1 exit status</p>
