免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1847 | 回复: 5
打印 上一主题 下一主题

linux的n p t l 库的帮助文档在哪里! [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2005-05-12 19:34 |只看该作者 |倒序浏览
要用什么库文件才可以编译
含有线程处理的程序
我编译以前用LINUX THREAD的程序出现如下错误!
[root@sky thread]# gcc lifecycle.c -o lifecycle
/tmp/ccaN0qnm.o(.text+0x45): In function `main':
: undefined reference to `pthread_create'
/tmp/ccaN0qnm.o(.text+0x70): In function `main':
: undefined reference to `pthread_join'
collect2: ld returned 1 exit status
请高手帮忙,谢谢!!

论坛徽章:
0
2 [报告]
发表于 2005-05-12 19:38 |只看该作者

linux的n p t l 库的帮助文档在哪里!

加入线程库后如下
[root@sky thread]# g++ lifecycle.c -o lifecycle -lpthread
/lib/libpthread.so.0: undefined reference to `__on_exit@GLIBC_PRIVATE'
/lib/libpthread.so.0: undefined reference to `_errno@GLIBC_2.0'
/lib/libpthread.so.0: undefined reference to `__libc_sigaction@GLIBC_PRIVATE'
/lib/libpthread.so.0: undefined reference to `_h_errno@GLIBC_2.0'
collect2: ld returned 1 exit status

论坛徽章:
0
3 [报告]
发表于 2005-05-12 20:52 |只看该作者

linux的n p t l 库的帮助文档在哪里!

gcc lifecycle.c -o lifecycle -lpthread

论坛徽章:
0
4 [报告]
发表于 2005-05-12 21:10 |只看该作者

linux的n p t l 库的帮助文档在哪里!

请问NPTL的库名同LINUXTHREAD相同?

论坛徽章:
0
5 [报告]
发表于 2005-05-12 21:36 |只看该作者

linux的n p t l 库的帮助文档在哪里!

库名是一样的,NPTL为了兼容linuxthread,所以才使用了和linuxthread一样的库名pthread。

论坛徽章:
0
6 [报告]
发表于 2005-05-13 10:46 |只看该作者

linux的n p t l 库的帮助文档在哪里!

linux的n p t l 库是否有帮助文档!
是不是用原来的pthread库的帮助文档
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP