V
vertigo
Hello
I have class Node and function:
void Node::Start(void){
pthread_create(&ServerLoopThread,NULL,&Node::StartServerLoop,NULL);
}
void Node::StartServerLoop(void){
...
}
and durring compilation i receive error:
Node.c: In member function `void Node::Start()':
Node.c:21: error: cannot convert `void (Node::*)()' to `void*(*)(void*)'
for
argument `3' to `int pthread_create(pthread_t*, const pthread_attr_t*,
void*(*)(void*), void*)'
make: *** [Node.o] Error 1
when i changed to:
pthread_create(&ServerLoopThread,NULL,(void*(*)(void*))&Node::StartServerLoop,NULL);
i receive error:
Node.c: In member function `void Node::Start()':
Node.c:20: error: converting from `void (Node::*)()' to `void*(*)(void*)'
make: *** [Node.o] Error 1
Why ?
How can i correct it ?
Thanx
Michal
I have class Node and function:
void Node::Start(void){
pthread_create(&ServerLoopThread,NULL,&Node::StartServerLoop,NULL);
}
void Node::StartServerLoop(void){
...
}
and durring compilation i receive error:
Node.c: In member function `void Node::Start()':
Node.c:21: error: cannot convert `void (Node::*)()' to `void*(*)(void*)'
for
argument `3' to `int pthread_create(pthread_t*, const pthread_attr_t*,
void*(*)(void*), void*)'
make: *** [Node.o] Error 1
when i changed to:
pthread_create(&ServerLoopThread,NULL,(void*(*)(void*))&Node::StartServerLoop,NULL);
i receive error:
Node.c: In member function `void Node::Start()':
Node.c:20: error: converting from `void (Node::*)()' to `void*(*)(void*)'
make: *** [Node.o] Error 1
Why ?
How can i correct it ?
Thanx
Michal