要使用#include<pthread.h>
库,编译的时候需要在末尾加上 –lpthread
。
例如要将ex2.c编译为ex2执行文件时,需要输入的内容为: gcc ex2.c –o ex2 –lpthread
linux要使用pthread.h库时,文件编译的时候需要在末尾加上 –lpthread。
最新推荐文章于 2023-04-27 11:45:11 发布
要使用#include<pthread.h>
库,编译的时候需要在末尾加上 –lpthread
。
例如要将ex2.c编译为ex2执行文件时,需要输入的内容为: gcc ex2.c –o ex2 –lpthread