Tag Archives: No matching function call to ‘pthread_create’

No matching function call to ‘pthread_create’ [How to Solve]

Error: No matching function call to ‘pthread_create’

 1 #include <pthread.h>
 2  
 3 void *draw(void *pt) {
 4     // ...
 5 }
 6  
 7 void *input(void *pt) {
 8     // ....
 9 }
10  
11 void Game::create_threads(void) {
12     pthread_t draw_t, input_t;
13     pthread_create(&draw_t, NULL, &Game::draw, NULL);   // Error
14     pthread_create(&input_t, NULL, &Game::draw, NULL);  // Error
15     // ...
16 }

Reason.
The function of pthread_create must be in the format (void*)(*)(void*)

Link:

http://stackoverflow.com/questions/10389384/no-matching-function-call-to-pthread-create