社区
工具平台和程序库
帖子详情
如何在vc6.0++中安装Zthread库啊
龙小VIP
2009-09-22 10:49:26
从网上下了个Zthread库源文件,但在vc6.0++上不会有,还请高手帮助啊
...全文
324
8
打赏
收藏
如何在vc6.0++中安装Zthread库啊
从网上下了个Zthread库源文件,但在vc6.0++上不会有,还请高手帮助啊
复制链接
扫一扫
分享
转发到动态
举报
写回复
配置赞助广告
用AI写文章
8 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
Jalien
2009-10-20
打赏
举报
回复
错误提示发生重定义错误。应该是你
这个工程的运行库与你编译ZThread.lib选择的运行库选项不同
。
选择一样的运行库就可以了。
譬如你可以都选择运行库选项为/MT (链接的是LIBCPMT.LIB,多线程静态链接的Release版本)
fox000002
2009-09-22
打赏
举报
回复
建个 static library 的 project
导入源文件 .cxx 文件
编译即可
龙小VIP
2009-09-22
打赏
举报
回复
都指定了,如:Link\input
现在的情况是:只要我用Thread t(new aRunnable); 就报异常。
Wolf0403
2009-09-22
打赏
举报
回复
工程参数指定链接 zthread 库没有?
龙小VIP
2009-09-22
打赏
举报
回复
编译通过了。我把lib文件考到了vc98\lib下面,然后编译了一个测试程序,报异常,异常如下:
--------------------Configuration: zthread_test_0922 - Win32 Debug--------------------
Linking...
msvcprtd.lib(MSVCP60D.dll) : error LNK2005: "public: __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >(char const *,class std::a
llocator<char> const &)" (??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@PBDABV?$allocator@D@1@@Z) already defined in libcpmtd.lib(ios.obj)
msvcprtd.lib(MSVCP60D.dll) : error LNK2005: "public: __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::~basic_string<char,struct std::char_traits<char>,class std::allocator<char> >(void)" (??1?$basic_strin
g@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ) already defined in libcpmtd.lib(iostream.obj)
msvcprtd.lib(MSVCP60D.dll) : error LNK2005: "public: __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >(class std::basic_string<c
har,struct std::char_traits<char>,class std::allocator<char> > const &)" (??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@ABV01@@Z) already defined in libcpmtd.lib(ios.obj)
msvcprtd.lib(MSVCP60D.dll) : error LNK2005: "public: __thiscall std::_Lockit::~_Lockit(void)" (??1_Lockit@std@@QAE@XZ) already defined in libcpmtd.lib(xlock.obj)
msvcprtd.lib(MSVCP60D.dll) : error LNK2005: "public: __thiscall std::_Lockit::_Lockit(void)" (??0_Lockit@std@@QAE@XZ) already defined in libcpmtd.lib(xlock.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: _abort already defined in LIBCMTD.lib(abort.obj)
LINK : warning LNK4098: defaultlib "MSVCRT" conflicts with use of other libs; use /NODEFAULTLIB:library
Debug/zthread_test_0922.exe : fatal error LNK1169: one or more multiply defined symbols found
Error executing link.exe.
zthread_test_0922.exe - 7 error(s), 1 warning(s)
---------------------------------------------------------------
代码如下:
#include "zthread/thread.h"
#include"zthread/Runnable.h"
#include <iostream>
using namespace std;
using namespace ZThread;
class aRunnable : public Runnable {
void run() {
Thread::sleep(1000);
std::cout << "Hello from another thread" << std::endl;
}
};
int main() {
try {
// Implictly constructs a Task
Thread t(new aRunnable);
} catch(Synchronization_Exception& e) {
std::cerr << e.what() << std::endl;
}
std::cout << "Hello from the main thread" << std::endl;
// Output:
// Hello from the main thread
// Hello from another thread
cin.get();
return 0;
}
龙小VIP
2009-09-22
打赏
举报
回复
e:\学习研究\研究\源代码\zthread-2.3.2\zthread-2.3.2\src\threadimpl.cxx(441) : error C2086: 'i' : redefinition
ThreadLocalImpl.cxx
ThreadOps.cxx
d:\program files\microsoft visual studio\vc98\include\utility(21) : warning C4786: 'std::pair<std::_Tree<ZThread::ThreadLocalImpl const *,std::pair<ZThread::ThreadLocalImpl const * const,ZThread::CountedPtr<ZThread::ThreadLocalImpl::Value,unsigned i
nt> >,std::map<ZThread::ThreadLocalImpl const *,ZThread::CountedPtr<ZThread::ThreadLocalImpl::Value,unsigned int>,std::less<ZThread::ThreadLocalImpl const *>,std::allocator<ZThread::CountedPtr<ZThread::ThreadLocalImpl::Value,unsigned int> > >::_Kfn,
std::less<ZThread::ThreadLocalImpl const *>,std::allocator<ZThread::CountedPtr<ZThread::ThreadLocalImpl::Value,unsigned int> > >::iterator,bool>::pair<std::_Tree<ZThread::ThreadLocalImpl const *,std::pair<ZThread::ThreadLocalImpl const * const,ZThre
ad::CountedPtr<ZThread::ThreadLocalImpl::Value,unsigned int> >,std::map<ZThread::ThreadLocalImpl const *,ZThread::CountedPtr<ZThread::ThreadLocalImpl::Value,unsigned int>,std::less<ZThread::ThreadLocalImpl const *>,std::allocator<ZThread::CountedPtr
<ZThread::ThreadLocalImpl::Value,unsigned int> > >::_Kfn,std::less<ZThread::ThreadLocalImpl const *>,std::allocator<ZThread::CountedPtr<ZThread::ThreadLocalImpl::Value,unsigned int> > >::iterator,bool>' : identifier was truncated to '255' characters
in the debug information
e:\学习研究\研究\源代码\zthread-2.3.2\zthread-2.3.2\src\win32\threadops.cxx(169) : error C2039: '_beginthreadex' : is not a member of '`global namespace''
e:\学习研究\研究\源代码\zthread-2.3.2\zthread-2.3.2\src\win32\threadops.cxx(169) : error C2065: '_beginthreadex' : undeclared identifier
e:\学习研究\研究\源代码\zthread-2.3.2\zthread-2.3.2\src\win32\threadops.cxx(188) : error C2039: '_endthreadex' : is not a member of '`global namespace''
e:\学习研究\研究\源代码\zthread-2.3.2\zthread-2.3.2\src\win32\threadops.cxx(188) : error C2065: '_endthreadex' : undeclared identifier
ThreadQueue.cxx
Time.cxx
Error executing cl.exe.
Zthread.lib - 5 error(s), 1 warning(s)
报的异常如下,请高手分析一下啊
龙小VIP
2009-09-22
打赏
举报
回复
[Quote=引用楼主 liudan319 的回复:]
从网上下了个Zthread库源文件,但在vc6.0++上不会有,还请高手帮助啊
[/Quote]
不对啊,编译出现问题
已编译的Z
Thread
多线程
库
总所周知,Z
Thread
库
是一款通用的多线程
库
,但需要自己编译 文件包含DEV vs2008
vc6.0
编译的Z
Thread
库
在VS2010或
VC6.0
中
,如何
安装
Z
thread
多线程
库
?
转自:http://zhidao.baidu.com/link?url=Z5qaOxPo16WMLpb39wJ9O4GvKeSqM4ClRoFTnr6Gg2VREi3G54IQSzwo20axhdvchSFaIpn7T05MHYDwKihv5a 一、在Windows下使用Z
Thread
首先,下载Z
Thread
,解压到某个目录下,我解压到D:\libs\Z
Thread
-2.3.2\
中
。 方法
C
++
三大
库
boost、loki、stlport
转: STL是一个标准,各商家根据这个标准开发了各自的STL版本。而在这形形色色的STL版本
中
,SGI STL无疑是最引人瞩目的一个。这当然是因为这个STL产品系出名门,其设计和编写 者名单
中
,Alexander Stepanov和Matt Austern赫然在内,有两位大师坐镇,其代码水平 自然有了最高的保证。SGI STL不但在效率上一直名列前茅,而且完全依照ISO C
++
之规范
应该了解的C
++
库
学习C
++
你必须了解以下知识:C
++
只是一种语言工具,你要编程序,做项目实现自己的想法单靠API是很费劲的,特别是针对重量级的项目。所以在实际工作时,你必须会至少1种C
++
开发
库
,这样你会更快更优地完成一项任务。------------------------------------------------------------------------------------摘录于:http:/
C
++
开发环境
C
++
开发环境: 1.Turbo C Turbo C是美国Borland公司的产品, 该公司在1987年首次推出Turbo C 1.0 产品, 其
中
使用了全然一新的集成开发环境, 即使用了一系列下拉式菜单,将文本编辑、程序编译、连接以及程序运行一体化, 大大方便了程序的开发。1988年, Borland 公司又推出Turbo C1.5版本, 增加了图形
库
和文本窗口函数
库
等, 而Turbo
工具平台和程序库
24,854
社区成员
27,343
社区内容
发帖
与我相关
我的任务
工具平台和程序库
C/C++ 工具平台和程序库
复制链接
扫一扫
分享
社区描述
C/C++ 工具平台和程序库
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章