pthread giving error: invalid conversion from ‘void* (*)(int*)’ to ‘void* (*)(void*)’
Hi All,
I just went to update some old code using pthreads and get the above error.The code did work in the past. I call the thread with Code:
pthread_create( &Test_Thread, NULL, &TestMovement, ( void * )amount ); Code:
void *TestMovement( void *data ) |
Quote:
|
No expert on it, I've used them and each time I do so, I look it up somewhere. This example seems very fundamental and there do seem to be some minor differences between their example and the minor amount of code you've shown.
http://timmurphy.org/2010/05/04/pthr...rking-example/ Suggest if you still have difficulties, that you post enough additional code so that we can see how you've declared Test_Thread and how you've coded TestMovement. |
Thanks that link demo fixed it, now what's even odder is some other threads in the same file are declared in exactly the same way ( my original way ) and they work...
|
There might be somewhere a declaration of 'TestMovement' that has 'int *' parameter instead of 'void *'
|
All times are GMT -5. The time now is 12:47 PM. |