读书人

C++导入ZThread遇到的有关问题

发布时间: 2012-07-31 12:33:46 作者: rapoo

C++导入ZThread遇到的问题 请指教
按照下面的叙述一步一步做的 但是编译的时候报错了

1、从www.zthread.sourceforge.net下载Zthread源文件
2、将include\下的zthread文件夹考到vc安装目录下,如:\Microsoft Visual Studio\VC98\Include
3、新建一个vc静态库的工程,将src文件下的.cxx文件导入到工程中去。注意:在src文件夹下还有其他文件夹,不要将这些文件夹里的.cxx 文件导入到工程中去,以免与src文件下的cxx文件冲突
4、打开“工程\设置\c/c++\code gerenation中的use run timeliberty,选择多线程
5、编译
6,将zthread.lib考到vc安装目录下,如:Microsoft Visual Studio\VC98\Lib
7,从www.zthread.sourceforge.net下载测试代码进行测试。

有两个问题,一个是编译报错了,保存信息如下,第一次弄ZThread信息挺多的看着有点晕……
第二个问题是zthread.lib在哪?是编译生成的文件吗?
以上两个问题求教 谢谢了

报错如下:

--------------------Configuration: 2012072301 - Win32 Debug--------------------
Compiling...
AtomicCount.cxx
Time.cxx
ThreadQueue.cxx
ThreadOps.cxx
ThreadLocalImpl.cxx
ThreadImpl.cxx
c:\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
d:\c_code\zthread-2.3.2\zthread-2.3.2\src\threadimpl.cxx(441) : error C2086: 'i' : redefinition
ThreadedExecutor.cxx
Thread.cxx
SynchronousExecutor.cxx
Semaphore.cxx
RecursiveMutexImpl.cxx
RecursiveMutex.cxx
PrioritySemaphore.cxx
PriorityMutex.cxx
PriorityInheritanceMutex.cxx
PriorityCondition.cxx
PoolExecutor.cxx
Mutex.cxx
c:\program files\microsoft visual studio\vc98\include\xmemory(66) : warning C4786: '?construct@?$allocator@Ugroup_t@WaiterQueue@?%c:\program files\microsoft visual studio\vc98\include\zthread\poolexecutor.h2383432434@ZThread@@@std@@QAEXPAUgroup_t@Wa
iterQueue@?%c:\program files\microsoft visual studio\vc98\include\zthread\poolexecutor.h2383432434@ZThread@@ABU3456@@Z' : identifier was truncated to '255' characters in the debug information
c:\program files\microsoft visual studio\vc98\include\xmemory(59) : warning C4786: '?allocate@?$allocator@Ugroup_t@WaiterQueue@?%c:\program files\microsoft visual studio\vc98\include\zthread\poolexecutor.h2383432434@ZThread@@@std@@QAEPAUgroup_t@Wait
erQueue@?%c:\program files\microsoft visual studio\vc98\include\zthread\poolexecutor.h2383432434@ZThread@@IPBX@Z' : identifier was truncated to '255' characters in the debug information
c:\program files\microsoft visual studio\vc98\include\xmemory(68) : warning C4786: '?destroy@?$allocator@Ugroup_t@WaiterQueue@?%c:\program files\microsoft visual studio\vc98\include\zthread\poolexecutor.h2383432434@ZThread@@@std@@QAEXPAUgroup_t@Wait
erQueue@?%c:\program files\microsoft visual studio\vc98\include\zthread\poolexecutor.h2383432434@ZThread@@@Z' : identifier was truncated to '255' characters in the debug information
c:\program files\microsoft visual studio\vc98\include\xmemory(66) : warning C4786: '?construct@?$allocator@V?$CountedPtr@VGroupedRunnable@?%c:\program files\microsoft visual studio\vc98\include\zthread\poolexecutor.h2383432434@ZThread@@I@ZThread@@@s


td@@QAEXPAV?$CountedPtr@VGroupedRunnable@?%c:\program files\microsoft visual studio\vc98\include\zthread\poolexecutor.h2383432434@ZThread@@I@ZThread@@ABV34@@Z' : identifier was truncated to '255' characters in the debug information
c:\program files\microsoft visual studio\vc98\include\xmemory(68) : warning C4786: '?destroy@?$allocator@V?$CountedPtr@VGroupedRunnable@?%c:\program files\microsoft visual studio\vc98\include\zthread\poolexecutor.h2383432434@ZThread@@I@ZThread@@@std
@@QAEXPAV?$CountedPtr@VGroupedRunnable@?%c:\program files\microsoft visual studio\vc98\include\zthread\poolexecutor.h2383432434@ZThread@@I@ZThread@@@Z' : identifier was truncated to '255' characters in the debug information
c:\program files\microsoft visual studio\vc98\include\xmemory(59) : warning C4786: '?allocate@?$allocator@V?$CountedPtr@VGroupedRunnable@?%c:\program files\microsoft visual studio\vc98\include\zthread\poolexecutor.h2383432434@ZThread@@I@ZThread@@@st
d@@QAEPAV?$CountedPtr@VGroupedRunnable@?%c:\program files\microsoft visual studio\vc98\include\zthread\poolexecutor.h2383432434@ZThread@@I@ZThread@@IPBX@Z' : identifier was truncated to '255' characters in the debug information
Monitor.cxx
FastRecursiveMutex.cxx
FastMutex.cxx
CountingSemaphore.cxx
Condition.cxx
ConcurrentExecutor.cxx
执行 cl.exe 时出错.

2012072301.lib - 1 error(s), 0 warning(s)


[解决办法]

C/C++ code
d:\c_code\zthread-2.3.2\zthread-2.3.2\src\threadimpl.cxx(441) : error C2086: 'i' : redefinition 

读书人网 >C++

热点推荐