Undefined reference to pthread_create in Linux

后端 未结 14 2530
梦毁少年i
梦毁少年i 2020-11-22 03:18

I picked up the following demo off the web from https://computing.llnl.gov/tutorials/pthreads/

#include 
#include 
#define NU         


        
14条回答
  •  一整个雨季
    2020-11-22 03:55

    check man page and you will get.

    Compile and link with -pthread.

    SYNOPSIS
           #include 
    
           int pthread_create(pthread_t *thread, const pthread_attr_t *attr,
                              void *(*start_routine) (void *), void *arg);
    
    
           Compile and link with -pthread.
           ....
    

提交回复
热议问题