`

晚上遇到了两个很弱的问题

    博客分类:
  • Java
阅读更多
今晚上在写聊天消息类的时候,遇到了两个让自己很无语的错误,折腾啊。
第一个错误是抽象类不能被实例化的错误。这个错误估计正常人都不会犯的吧。我当时因为继承了三四个父类,嫌麻烦,就直接拷贝了以前的某代码,好了,结果不小心把一个抽象类给继承了。随后不管怎么编译,都会报这样的错误:
1>.\HandleMgr.cpp(4) : error C2259: 'HandleMgr' : cannot instantiate abstract class
due to following members:
1>        'void gloox::LogHandler::handleLog(gloox::LogLevel,gloox::LogArea,const std::string &)' : is abstract
1>        c:\program files\microsoft visual studio 9.0\vc\include\loghandler.h(48) : see declaration of 'gloox::LogHandler::handleLog'
以后要市场警惕着点,不要犯这种低级的错误了。
还有一个错误更让人哭笑不得,错误提示:
1>.\HandleMgr.cpp(3) : error C2628: 'HandleMgr' followed by 'void' is illegal (did you forget a ';'?)
无语吧,找了好一会儿,原来是class类掉;了。
哎,以后这两个错误一定不要再犯了,呵呵。
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics