Hi i am using suse 9.3 prof and kdevelope. I have a proble using posix threads in c++... I have include <pthread.h>
I have a class called Thread with 2 single methods:
void* Thread::func(void*) {
return NULL;
}
and i have another methos like this:
pthread_t Thread::makeThread( pthread_attr_t attr, void* arg ) {
pthread_t aux;
int answer;
answer=pthread_create(&aux,attr,func,arg);
return aux;
}
The problem is that it can't compile because it says:
erro: argument of type ' void*(Thread:
void*)/ does not match 'void* (*) (void*)
In fact, i have this 2 methodes in a same class and i want to make a thread that takes as a parametre a own methode, like in this case "func"
I have trie to put instead of func:
(void*)func
Thread::func
(void*)Thread::func
(void*)&func
and so on
please!! i really need to solve this!
ahh if i put the method func as static it works, but the problem is that i can't use it as static
thaks