问题解决: 对‘pthread_create’未定义的引用

由于pthread库不是Linux系统默认的库,连接时需要使用库libpthread.a,所以在使用pthread_create创建线程时,


在编译中要加-lpthread参数:

gcc -o pthread -lpthread pthread.c

你可能感兴趣的:(问题解决: 对‘pthread_create’未定义的引用)