首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > C++ >

EVC转VS2005 模板类实现出错 各位,愁死了

2012-03-13 
EVC转VS2005 模板类实现出错各位快来帮忙啊,愁死了有一个evv的工程转VS2005,其它的都改好了,但是其中有两

EVC转VS2005 模板类实现出错 各位快来帮忙啊,愁死了
有一个evv的工程转VS2005,其它的都改好了,但是其中有两个文件test1和test2的.h文件中友模板类,比如
typedef list<TruckMsg> TRUCKMSG_LIST;
typedef list<TruckMsg>::iterator TRUCKMSG_ITER;


typedef std::map<unsigned int,BOOL> type_map;
typedef type_map::iterator type_iter;

typedef list<TruckEvent> TRUCKEVENT_LIST;
typedef list<TruckEvent>::iterator TRUCKEVENT_ITER;

运行出现错误,
错误1error C2766: explicit specialization; 'std::iterator_traits<std::_Bool>' has already been definedE:\Program Files\Microsoft Visual Studio 8\VC\ce\include\xutility684
错误2error C2766: explicit specialization; 'std::_Ptr_cat_helper<std::_Bool*,std::_Bool*>' has already been definedE:\Program Files\Microsoft Visual Studio 8\VC\ce\include\xutility1158
错误6error C2535: 'std::basic_ostream<_Elem,_Traits> &std::basic_ostream<_Elem,_Traits>::operator <<(std::_Bool)' : member function already defined or declaredE:\Program Files\Microsoft Visual Studio 8\VC\ce\include\ostream276
错误8error C2535: 'std::basic_istream<_Elem,_Traits> &std::basic_istream<_Elem,_Traits>::operator >>(std::_Bool &)' : member function already defined or declaredE:\Program Files\Microsoft Visual Studio 8\VC\ce\include\istream278
又像是哪个头文件多次包含

但是我把test1和test2的.cpp文件删除,然后在test1.h文件最后加上test1.cpp,test2.h后面加上test2.cpp就没有错误了,但是这样不好调试,我想问问什么会这样,我怎么改才正确,谢谢各位

[解决办法]
难道你将模板分离编译?

热点排行