Undefined reference to pthread_create in Linux

后端 未结 14 2321
梦毁少年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 04:11

    You need to use the option -lpthread with gcc.

    0 讨论(0)
  • 2020-11-22 04:12

    Compile it like this : gcc demo.c -o demo -pthread

    0 讨论(0)
提交回复
热议问题