纯虚函数重载的错误:cannot instantiate abstract class due to following members

myfjdthink myfjdthink 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
最近在看一本书《数据结构与算法——面向对象的C++设计模式》 里面用类模板的形式讲解了栈,然后在实例化使用的时候碰到了如标题所示的问题,实在找不出问题的原因。只能上来求助了,代码较长。。就发到资源那里了,是整个工程。

源代码:
http://download.csdn.net/source/3227340

下面是错误提示:
:\myfjdthink\dsexp5\datatem\test.cpp(8) : error C2259: 'StackAsArray' : cannot instantiate abstract class due to following members:
d:\myfjdthink\dsexp5\datatem\stack_queue.h(25) : see declaration of 'StackAsArray'
d:\myfjdthink\dsexp5\datatem\test.cpp(8) : warning C4259: 'int __thiscall Object::CompareTo(const class Object &) const' : pure virtual function was not defined
d:\myfjdthink\dsexp5\datatem\container_iterator.h(16) : see declaration of 'CompareTo'
d:\myfjdthink\dsexp5\datatem\test.cpp(8) : error C2259: 'StackAsArray' : cannot instantiate abstract class due to following members:
d:\myfjdthink\dsexp5\datatem\stack_queue.h(25) : see declaration of 'StackAsArray'
d:\myfjdthink\dsexp5\datatem\test.cpp(8) : warning C4259: 'int __thiscall Object::CompareTo(const class Object &) const' : pure virtual function was not defined
d:\myfjdthink\dsexp5\datatem\container_iterator.h(16) : see declaration of 'CompareTo'
d:\myfjdthink\dsexp5\datatem\container_iterator.h(127) : error C2872: 'ostream' : ambiguous symbol
d:\myfjdthink\dsexp5\datatem\test.cpp(9) : see reference to class template instantiation 'Wrapper<int>' being compiled
Error executing cl.exe.

DataTem.exe - 3 error(s), 0 warning(s)
...全文

相关推荐

PHP严重致命错误处理:php Fatal error: Cannot redeclare class or function

1、错误类型:PHP致命错误 Error type: PHP Fatal error Fatal error: Cannot redeclare (a) (previously declared in (b)) in (c) on line (d) 2、错误描述: 该错误报告表示你正企图对已经定义过的函数进行再次定义,其中 a—-表示重复定义的函数名; b—-第一次定义该函数时的文件名称及行号; c—-第二次定义该函数时的文件名称; d—-第二次定义该函数时的行号。 3、原因及解决方法: 原因:你连续两次使用相同名称来定义一个函数,例如 function myFunction(){} func

weixin_38592405

SpringBoot启动报错Failed to determine a suitable driver class

主要介绍了SpringBoot启动报错Failed to determine a suitable driver class,小编觉得挺不错的,现在分享给大家,也给大家做个参考。一起跟随小编过来看看吧

weixin_38581447

Tomcat报错:HTTP Status 500 (Wrapper cannot find servlet class)解决办法

主要介绍了Tomcat报错:HTTP Status 500 (Wrapper cannot find servlet class)解决办法的相关资料,需要的朋友可以参考下

weixin_38746574

java方法重载示例

方法重载是以统一的方式处理不同数据类型的一种手段,这篇文章主要介绍了java方法重载示例,需要的朋友可以参考下

weixin_38592502

tomcat报错:Wrapper cannot find servlet class ...问题解决

主要介绍了tomcat报错:Wrapper cannot find servlet class ...问题解决的相关资料,需要的朋友可以参考下

weixin_38592455
评论 11
收藏 已收藏
分享
返回顶部
myfjdthink
VC/MFC 16,550 成员 421,606 内容