Access issue regarding static variable
<p>I have a class Class1 in some header file Class1.hpp</p>

<pre><code> class Class1
 {
   static std::vector&lt;bool&gt; var1;
   func();
  }


func()
{
 var1.clear();
 int t=0;
 do
 {
   var1.push_back(t++);
 }while(true); //its some condition
</code></pre>

<p>Now inside another function main() in another class in another file, i am assigning var1 to another std::vector like:</p>

<pre><code> std::vector&lt;bool&gt; var2=Class1::var1;
</code></pre>

<p>When I am doing this its giving me the error: </p>

<pre><code>undefined reference to Class1::var1
</code></pre>

<p>I am not getting what am I doing wrong. Can someone be kind enough to help in rectifying the error?</p>
