struch stash { 
....
}; 
应该是 struct stash{
...
};

解决方案 »

  1.   

    错误信息:libtest.obj : error LNK2001: unresolved external symbol "public: void __thiscall Stash::cleanup(void)" (?cleanup@Stash@@QAEXXZ)
    libtest.obj : error LNK2001: unresolved external symbol "public: void * __thiscall Stash::fetch(int)" (?fetch@Stash@@QAEPAXH@Z)
    libtest.obj : error LNK2001: unresolved external symbol "public: int __thiscall Stash::count(void)" (?count@Stash@@QAEHXZ)
    libtest.obj : error LNK2001: unresolved external symbol "public: int __thiscall Stash::add(void *)" (?add@Stash@@QAEHPAX@Z)
    libtest.obj : error LNK2001: unresolved external symbol "public: void __thiscall Stash::intitialize(int)" (?intitialize@Stash@@QAEXH@Z)
    Debug/libtest.exe : fatal error LNK1120: 5 unresolved externals
    Error executing link.exe.
      

  2.   

    将 struch 改为struct,还是不对。
      

  3.   

    struct该成class,结构里不能有函数定义
      

  4.   

    结构里是可以有函数定义的,但这里将STRUCT 改为CLASS是办法之一。出错原因可能是结构内的函数定义方法与类成员函数的定义方法不一样,而你按照类成员函数的方法定义函数,连接时肯定出错,找不到相应的函数。具体如何定义结构的成员函数,要查一下。