title: static const in c++ class: undefined reference
body: <p>I have a class for local use only (i.e., its cope is only the c++ file it is defined in)</p>
  
  <pre><code>class A {
  public:
      static const int MY_CONST = 5;
  };
  
  void fun( int b ) {
      int j = A::MY_CONST;  // no problem
      int k = std::min&lt;int&gt;( A::MY_CONST, b ); // link error: 
                                              // undefined reference to `A::MY_CONST` 
  }
  </code></pre>
  
  <p>All the code reside in <strong>the same c++</strong> file. When compiling using VS on windows, there is no problem at all.<br>
  However, when compiling on Linux I get the <code>undefined reference</code> error only for the second statement.</p>
  
  <p>Any suggestions?</p>