按照老师的代码写,为什么分文件类外定义一直报错
错误 1 error LNK2005: "public: int __thiscall Teacher::getAge(void)" (?getAge@Teacher@@QAEHXZ) 已经在 demo.obj 中定义 D:\C++程序\demo\demo\Teacher.obj demo
错误 2 error LNK2005: "public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __thiscall Teacher::getGender(void)" (?getGender@Teacher@@QAE?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ) 已经在 demo.obj 中定义 D:\C++程序\demo\demo\Teacher.obj demo