关于pthread_create未定义的引用的奇葩解决

1本来在代码里包含了pthread.h  第一次编译:gcc -o create create.c  提示错误 未定义的引用

2后来知道linux标准库没有pthread.h 要链接之-lpthread  第二次编译:gcc -o create -lpthread create.c  仍然提示错误 未定义的引用!

3再后来。。。。。发现,-lpthread应该写在末尾  第三次编译:gcc -o create create.c -lpthread 编译成功。。。。。

posted @ 2013-09-03 15:49  leechanx  阅读(9270)  评论(0编辑  收藏  举报