error LNK2001: 无法解析的外部符号 "public: static class std::vector<class......

来源:互联网 发布:淘宝投诉客服电话 编辑:程序博客网 时间:2024/05/17 08:55
vector类型作为class的static成员,需要在class外 define。
如:
class MyClass {private:    static std::vector<float> myObjectCache;public:    static void UpdateCache ();};
需要在类外
std::vector<float> MyClass::myObjectCache;
当然其他的数据类型同样如此。
原创粉丝点击