作者tiffiej (小小)
看板EE_DSnP
标题[问题] virtual functions are abstract
时间Sat Mar 14 11:30:52 2009
在declare objects of class Less and Greater 的时候
他会跑出error message 说
"cannt declare variable "a" to be of type "Less"
because the following virtual functions are abstract:
virtual bool Compare::compare(int, int) const"
然後下面会出现一句 :"at global scope".
请问这个error message是什麽意思呢?
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 140.112.225.73
1F:推 ric2k1:试试看将 1724 篇之 refCode/031309_funcObj.cpp 的第19行 03/14 13:32
2F:→ ric2k1:的最右边的 const 删掉, 再 compile 看看, 你应该会看到 03/14 13:32
3F:→ ric2k1:类似的 error message ==> 检查一下与 base class 的 03/14 13:33
4F:→ ric2k1:function prototype 是否一致 03/14 13:33