void value not ignored as it ought to be” - What is wrong?

I created a class "semaphore" with a method "reader" this way:

void semaforo::reader(sem_t x, sem_t y,sem_t z,sem_t rsem,sem_t wsem){
cout<<"----------------"<<endl;
cout<<"Leitor esta Lendo"<<endl;
sem_wait(&z);
sem_wait(&rsem);
sem_wait(&x);
int aux = readcountM(0);
if(aux ==1){
sem_wait(&wsem);
}
sem_post(&x);
sem_post(&rsem);
sem_post(&z);
prints(1);
sem_wait(&x);
aux = readcountN(aux);
if(aux == 0){
sem_post(&wsem);
}
sem_post(&x);
}
In my main.cpp, I created these auxiliary variables, and instanced my class as follows:

sem_t x,y,z,rsem,wsem;
pthread_t read[3],write[2];

thread *teste2 = new thread();

// the following line triggers the error
teste2->pthread_creation(&read[0],NULL,(void *)teste->reader(x, y, z, rsem, wsem),NULL);

With this I get the following error:
void value not ignored as it ought to be

I know my reader method returns empty, however how can I rewrite my code correctly? * I am a beginner in C ++. I need help, thank you in advance!
You cannot use the non-existent value returned by a function with a return type of void. There is no such value.

It's hard to know how you can rewrite the code correctly since we don't have the relevant information. If thread::pthread_creation is an analog to pthread_create it seems likely you don't have a function with the correct signature to use in the call.
with your explanation, I've been able to solve the problem, thank you very much. !
Topic archived. No new replies allowed.