*错误的编译:
[root@localhost c_test]# gcc exam_26.c -o exam_26.c
/tmp/cc9l1gOq.o:在函数‘main’中:
exam_26.c:(.text+0x4f):对‘pthread_create’未定义的引用
exam_26.c:(.text+0xbf):对‘pthread_join’未定义的引用
正确的编译:
gcc exam_26.c -lpthread -o exam_26
*错误的编译:
[root@localhost c_test]# gcc exam_26.c -o exam_26.c
/tmp/cc9l1gOq.o:在函数‘main’中:
exam_26.c:(.text+0x4f):对‘pthread_create’未定义的引用
exam_26.c:(.text+0xbf):对‘pthread_join’未定义的引用
正确的编译:
gcc exam_26.c -lpthread -o exam_26
本文标题:pthread.h引用时编译c代码要link该库
本文链接:https://www.haomeiwen.com/subject/utplohtx.html
网友评论