defining an struct in seperated class file ERROR

hi all
i've defined an strcuct in .h file and i read its variable in a method in .cpp file ,but i'v got error.

.H file:
class myclass{
public:
struct opt_struct
{
vector<int> tmplsize;
vector<double> posSig;
vector<double> affsig;
};
static struct opt_struct opt;
}


.cpp file:
myclass::myfunc()
{
int w=round(param[2] * opt.tmplsize[0]); //the problem is here
}

when i declare the struct without static , it doesn't recognize my struct and with static i face linker error:
Error 33 error LNK1120: 1 unresolved externals
i couldn't solve it
what if i want to use my struct as normal?(without static)
then it says:
a non-static member reference must be relative to a specific object

thank you so much
http://www.cplusplus.com/forum/articles/40071/#msg216313
`myfunc()' is not declared as a member function of your class and it is missing a return type.
Topic archived. No new replies allowed.