在Window和Linux下使用Zthread库
ZThread库是一个开源的跨平台高级面向对象的线性和sycnchronization 库,以运行POSIX 和Win32 系统中的C++程序。 ZThread库的主页: http://zthread.sourceforge.net 最新版本Zthread远吗下载地址: http://prdownloads.sourceforge.net/zthread/ZThread-2.3.2.tar.gz ZThread文档: http://zthread.sourceforge.net/documentation.html 一、 在Windows 下使用ZThread 首先,下载ZThread,解压到某个目录下,我解压到D:\libs\ZThread-2.3.2\中。 方法1 :包含源文件直接编译( 不推荐) 1.在vs2010中,新建一个新的win32 控制台项目,选择空项目。 2.在源目录下新建一个main.cpp文件,在 http://zthread.sourceforge.net/html/classZThread_1_1Thread.html 中复制一段示例代码拷贝到main.cpp中。 3.在项目的配置属性中,VC++目录的包含目录中增加ZThread的头文件目录,我这里是:D:\libs\ZThread-2.3.2\include。配置属性分DEBUG和RELEASE两个