linux 多线程 遇到的问题

来源:互联网 发布:软件开发流程管理制度 编辑:程序博客网 时间:2024/05/01 02:46

关于对‘pthread_create’未定义的引用解决方法

原文地址:http://hi.baidu.com/phillisbovie/item/29912853523e7d10aaf6d7f8

create.c:(.text+0x2a):对‘pthread_create’未定义的引用

开始搜索的时候,知道缺少连-lpthread该库支持,使用:

xs@vm:~/function/september/thread$ gcc -lpthread create.c

仍然报出一样的错误。

后面man gcc

才知道Usage: gcc [options] file...

因此需要将库链接放在末尾。

xs@vm:~/function/september/thread$ gcc create.c -lpthread


0 0
原创粉丝点击