ios - Implicit declaration of function 'pthread_mutex_init' is invalid in C99 -
i trying lock method mutec article here states create member variable of class such
pthread_mutex_t mutex; then initialize such
pthread_mutex_init(&mutex, null); then use such
void mylockingfunction() { pthread_mutex_lock(&mutex); // work. pthread_mutex_unlock(&mutex); } i getting following warning @ step 2 when initialize it.
implicit declaration of function 'pthread_mutex_init' invalid in c99 what mean ? should ignore ?
it means have not included header file declares function, compiler doesn't know @ point use it. you're trying implicitly declare using it, invalid.
if check man page pthread_mutex_init(), tells you should use following line import declaration:
#include <pthread.h> if put near top of source file, warning go away.
Comments
Post a Comment