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
Similar Posts:
- invalid conversion from ‘void* (*)()’ to ‘void* (*)(void*)’
- Undefined reference to ‘pthread’ appears in Linux Ubuntu running thread program_ Create ‘and undefined reference to’ pthread ‘_ ‘join’ error.
- Cmake solves the problem of phread Library in C + + 11: undefined reference to ` pthread_ create’
- Hi3516DV300 Chip Error: “undefined reference to ×”
- Solution to the problem that ends with cannot locate in XPath
- The solution of “no matching function for call to…” in G + + compilation
- Error in compiling APR util for Linux
- fatal error: ‘openssl/conf.h’ file not found [How to Solve]
- C write and read file via FILE and open method in a+ or r mode
- How to Solve the window flicker problem caused by AWT components