using compile time constant throws error
<p>in the below program i have used static const int init. But it is throwing error 
/tmp/ccEkWmkT.o(.text+0x15d): In function <code>check::operation()':
: undefined reference to</code>check::init'</p>

<p>This error is coming only when used with vector. Can someone please help? what is the exact behaviour??</p>

<pre><code>#include&lt;vector&gt;
#include&lt;iostream&gt;
using namespace std;

class check{
static const int init=1;
public:
    check(){}
    void operation();
};

void check::operation(){
    vector&lt;int&gt; dummy;
    dummy.push_back(init);
}

int main(){
    check ck;
    ck.operation();
}
</code></pre>
