error LNK2001: 无法解析的外部符号 "public: virtual int __thiscall Game::LevelTwo(void)"

来源:互联网 发布:facebook无法连接网络 编辑:程序博客网 时间:2024/06/01 07:56

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; }};



0 0