Problem:
error LNK2001: 无法解析的外部符号 "public: virtual int __thiscall Game::LevelTwo(void)" (?LevelTwo@Game@@UAEHXZ)
Solution:
我在写基类时,写虚函数只定义了并没有函数体,只要把函数体补全就解决问题了
<span style="font-size:14px;">class Game
{
public:
virtual int LevelOne();
virtual int LevelTwo();
virtual int LevelThree();
};
class Game
{
public:
virtual int LevelOne(){ return 1; }
virtual int LevelTwo() { return 1; }
virtual int LevelThree(){ return 1; }
};