[ANSWERED]Declaration is incompatible

[ANSWERED]Declaration is incompatible
0.0 0


Hello everyone, I’m pretty new to c++ programming but kinda intermediate programmer in general.

Currently I’m getting this error Declaration is incompatible with “void HelloWorld::functionName( dt)” (declared on your HelloWorld.h.
I already declared the functionName as public inside HelloWorld.h


#include "cocos2d.h"

#include "SimpleAudioEngine.h"

class HelloWorld : public cocos2d::CCLayer
    virtual bool init();  
    static cocos2d::CCScene* scene();
    void functionName(ccTime dt);
    virtual void menuCloseCallback(CCObject* pSender);

Then on my HelloWorldScene.cpp

void HelloWorld::functionName(ccTime dt)


The functionName on HelloWorldScene.cpp gets the wavy red line thingy beneath it indicating the error.


Nevermind I found the solution. For those who haven’t figure this out yet add using namespace cocos2d on HelloWorld.h.