I'm writing a class with pthreads in it, with it's header, and .cpp definition files.
In the .h i have:
class test
{
public:
int a;
...
private:
typedef void (*myfunc)(void *p);
static myfunc pthreadRun;
}
In the .cpp i have:
...
typedef void (*myfunc)(void *p);
myfunc test::pthreadRun
{
this->a = 10;
pthread_exit(NULL);
}
...
I get an error: void (* test::pthreadRun)(void*)
is not a static member of class test
, and a bunch of other errors too, but this is the first one.
I'm confused as it is declared static :/
pthreadRun
is the thread run function for pthread_create()
What am I missing?