win32下使用pthread

来源:互联网 发布:手机usb共享网络 编辑:程序博客网 时间:2024/04/30 20:37

1  pthread下载地址:ftp://sourceware.org/pub/pthreads-win32

2 mingw使用pthread步骤(静态链接pthread而不需要dll):

 a)编译pthread,进入pthreads.2目录下,输入make clean GC-static命令,在当前目录下生产libpthreadGC2.a

 b)复制Pre-built.2\include下.h文件到mingw\include目录下,复制libpthreadGC2.a到mingw\lib下并改名为libpthread

 c)源程序编写,引用pthread......

 d)编译源程序时加上-DPTW32_STATIC_LIB编译选项

 e)链接程序时加上 -lpthread


0 0
原创粉丝点击