多线程 undefined reference to 'pthread_create' 解决办法
来源:互联网 发布:千里眼软件收费吗 编辑:程序博客网 时间:2024/06/05 05:19
使用pthread.h中得函数时
undefined reference to 'pthread_create'
undefined reference to 'pthread_join'
问题原因:
pthread 库不是 Linux 系统默认的库,连接时需要使用静态库 libpthread.a,所以在使用pthread_create()创建线程,以及调用 pthread_atfork()函数建立fork处理程序时,需要链接该库。
问题解决:
在编译中要加 -lpthread参数
gcc thread.c -o thread -lpthread
thread.c为你些的源文件,不要忘了加上头文件#include<pthread.h>
undefined reference to 'pthread_create'
undefined reference to 'pthread_join'
问题原因:
pthread 库不是 Linux 系统默认的库,连接时需要使用静态库 libpthread.a,所以在使用pthread_create()创建线程,以及调用 pthread_atfork()函数建立fork处理程序时,需要链接该库。
问题解决:
在编译中要加 -lpthread参数
gcc thread.c -o thread -lpthread
thread.c为你些的源文件,不要忘了加上头文件#include<pthread.h>
- 多线程 undefined reference to 'pthread_create' 解决办法
- linux多线程 undefined reference to 'pthread_create'
- undefined reference to 'pthread_create'
- undefined reference to 'pthread_create'
- undefined reference to 'pthread_create'
- undefined reference to `pthread_create'
- undefined reference to `pthread_create'
- undefined reference to ’pthread_create‘
- undefined reference to 'pthread_create'
- undefined reference to 'pthread_create'
- undefined reference to `pthread_create'
- undefined reference to 'pthread_create'
- undefined reference to `pthread_create'
- undefined reference to 'pthread_create'
- undefined reference to 'pthread_create'
- undefined reference to `pthread_create'
- undefined reference to 'pthread_create'
- :undefined reference to `pthread_create’
- 一个地址的旅程
- find命令
- ADO(ActiveX Data Objects)微软提供的一种数据库访问技术
- 在64位ubuntu11.10中用锐捷上网
- cab包中的的inf文件编写
- 多线程 undefined reference to 'pthread_create' 解决办法
- socket的发送与接收缓冲区(转)
- sql server删除所有表
- 实用的java分页ajax分页和普通分页
- “在应用程序级别之外使用注册为 allowDefinition=’MachineToApplication’ 的节是错误的。如果在 IIS 中没有将虚拟目录配置为应用程序,则可能导致此错误”的解决方法
- 关注C++细节——static类成员使用注意
- Linux 操作系统的时钟系统
- ODBC+ADO编程总结
- WinCE显示资源中BMP图片的几种方法