悬赏VS2005中使用vector iterator导致链接错误2001的问题,卡了我3天了
同样一个工程,VS2003下编译无任何问题,MT 多线程。链接生成EXE。
到了VS2005下,编译没问题,链接产生一堆错误:
error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: class std::_Vector_iterator<class Node *,class std::allocator<class Node *> > __thiscall Node::child_end(void)" (__imp_?child_end@Node@@QAE?AV?$_Vector_iterator@PAVNode@@V?$allocator@PAVNode@@@std@@@std@@XZ),该符号在函数 "public: virtual void __thiscall CBulletLayer::update(float)" (?update@CBulletLayer@@UAEXM@Z) 中被引用
代码中使用到这个一个导出类:
///////////////////////////////////////////////////////////
class Xlbe_Export Node
{
public:
typedef std::vector<Node *> Nodes;
typedef std::vector<Action *> Actions;
public:
Node();
virtual ~Node();
。。。。。
};
导致只要是用到vector的 iterator 都会导致出现这个问题。
怀疑是对STL的支持不一致;把 VS2003的VECTOR文件复制过来,可以编译,但是运行出错:std_bad_alloc 这个问题卡了我3天了!不信就我一个人遇到过!