error: invalid conversion from ‘void*’ to ‘void* (*)(void*)’ - pthreads

后端 未结 4 594
我在风中等你
我在风中等你 2021-02-14 15:30
anisha@linux-y3pi:~> g++ conditionVarTEST.cpp -Wall

conditionVarTEST.cpp: In function ‘int main()’:
conditionVarTEST.cpp:33:53: error: invalid conversion from ‘void*         


        
4条回答
  •  走了就别回头了
    2021-02-14 16:03

    Use

    pthread_create (&A, NULL, functionA, NULL); 
    

    instead of casting.

    Also the function you use to pass to pthread_create should return a void* so to avoid any problems later, consider changing the function signature to accomodate this.

提交回复
热议问题