继承一个虚类的时候要小心是,并使其实例化时.必须使其全实重写了纯虚的方法...类定义的位置

http://stackoverflow.com/questions/7352706/cannot-allocate-an-object-of-abstract-type-error

In C++ a class with at least one pure virtual function is called Abstract class and you cannot create objects of that class, You can only have pointers or references to it.

If you are deriving from an Abstract class make sure you override and define all Pure virtual functions for your class.

就是由于继承基类中一个纯虚方法写错了..最后报错报得太夸张了...

报出的是不能让一个纯虚类去实例化.....

另外...其实还是不同的类放不同的文件,不然前后间..类与类之间的关系..位置就很重要了.

而用文件间的包含可以用include 来解决..这样做也会比较好一点....

原文地址:https://www.cnblogs.com/vimmer/p/2745683.html