ccTouchesBegan can not be override

Hi guys,

I got a class GameLayer: public cocos2d::CCLayer. I try to override it in GameLayer, but it show the error “inherited member is not allowed”.

void GameLayer::ccTouchesBegan(CCSet pTouches, CCEventpEvent)
{
_hero->attack();
}

anyone can help, muchas gracias

You need to declare it as virtual.

Yes, Thanks! It works.