why error LNK2001: unresolved external symbol in this case?
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/3536372/defining-static-members-in-c">Defining static members in C++</a><br>
  <a href="http://stackoverflow.com/questions/11249314/static-method-with-a-field">Static method with a field</a>  </p>
</blockquote>



<p>I found the below code on singleton implementation on the web, and decide to give it a try:</p>

<pre><code>#include &lt;iostream&gt;

class Singleton
{
    Singleton(){}
    static Singleton *s_instance;

public:
    static Singleton* getInstance()
    {
        if(!s_instance)
            s_instance = new Singleton();

        return s_instance;
    }
};

int main()
{
    Singleton::getInstance();
    return(0);
}
</code></pre>

<p>It looks quite straight forward. But when I build it in Visual Studio, it gives a linker error message:</p>

<pre><code>main.obj : error LNK2001: unresolved external symbol "private: static class Singleton
* Singleton::s_instance" (?s_instance@Singleton@@0PAV1@A)
C:\Users\boll\Documents\Visual Studio 2010\Projects\hello_world\Debug\hello_world.exe :
fatal error LNK1120: 1 unresolved externals'
</code></pre>

<p>Why is '<code>s_instance</code>' unresolved in this case?</p>
