I have a class Class1 in some header file Class1.hpp
class Class1
{
static std::vector<bool> var1;
func();
}
func()
{
var1.clear();
int t=0;
do
{
var1.push_back(t++);
}while(true); //its some condition
Now inside another function main() in another class in another file, i am assigning var1 to another std::vector like:
std::vector<bool> var2=Class1::var1;
When I am doing this its giving me the error:
undefined reference to Class1::var1
I am not getting what am I doing wrong. Can someone be kind enough to help in rectifying the error?