error: undefined reference to `pthread_create'

来源:互联网 发布:淘宝不能用网银 编辑:程序博客网 时间:2024/05/03 13:02
error exist while using gcc to a source file which used the pthread library.


it's because the gcc parameter is not enough.
you can solve it with  -lpthread:
egg:

gcc mythread.c -o mythread -l pthread