D
darklupine
I'm working on a project for a class at school. In order to complete
the project, I have to create a new thread, but I'm not overly certain
on how to do so. I have it coded, but it still throws an error, and I
can't figure out why it is doing so.
The create line reads:
pthread_create(&thread1, NULL, (void *)&CourNet::recieve, NULL);
CourNet is my class name, and recieve is the function I'll be calling.
recieve returns (NULL) and its header is the following:
void * CourNet::recieve(void * pointer)
The error it returns when I try to compile (using g++, I'm not sure
what version it is) is as follows:
CourNet.cpp:103: converting from 'void*(CourNet::*)(void*)' to 'void*'
CourNet.cpp:103: invalid conversion from 'void*' to 'void*(*)(void*)'
I've mucked with the code a bit trying to fix it, adding the void *
return type on recieve instead of a regular void, and adding the void *
pointer parameter, as well as the return (NULL).
Can anyone give me any suggestions on how I might correct this error?
If you need any more information, let me know.
Thanks!
the project, I have to create a new thread, but I'm not overly certain
on how to do so. I have it coded, but it still throws an error, and I
can't figure out why it is doing so.
The create line reads:
pthread_create(&thread1, NULL, (void *)&CourNet::recieve, NULL);
CourNet is my class name, and recieve is the function I'll be calling.
recieve returns (NULL) and its header is the following:
void * CourNet::recieve(void * pointer)
The error it returns when I try to compile (using g++, I'm not sure
what version it is) is as follows:
CourNet.cpp:103: converting from 'void*(CourNet::*)(void*)' to 'void*'
CourNet.cpp:103: invalid conversion from 'void*' to 'void*(*)(void*)'
I've mucked with the code a bit trying to fix it, adding the void *
return type on recieve instead of a regular void, and adding the void *
pointer parameter, as well as the return (NULL).
Can anyone give me any suggestions on how I might correct this error?
If you need any more information, let me know.
Thanks!