在linux中使用pthread_create()函数创建线程时如果直接编译会产生错误: 对”ptread_create"未定义的引用 此时需要带参数 -lpthread 编译,以gcc编译器为例,完整的编译命令为: gcc -o outputfile sourcefile.c -lpthread 记得-lpthread参数放在最后。