当用下面的命令编译时会报undefined reference to 'pthread_create'
gcc fig11.2.c -o fig11.2.o
加上-lpthread参数即可,如下所示:
gcc fig11.2.c -o fig11.2.o -lpthread
结果如下图:
参考资料:
[1]undefined reference to 'pthread_create'问题解决[转],http://oliver6.blog.163.com/blog/static/18384104020107175351941/