compile error: 'class cocos2d::CCApplication' has no member named 'GetCurrentApplication'

When I compiled my game with cygwin,there was an error appeared:

xxx.cpp:line 34:" ‘class cocos2d::CCApplication’ has no member named ‘GetCurrentApplication’ ".

then I checked my code in xxx.ccp at line 34,it’s wrote like this:

#include "AppDelegate.h"
...
...
...
line 34: AppDelegate *p_delegate=(AppDelegate*)(CCApplication::sharedApplication().GetCurrentApplication());

Actually,the code had run perfectly on my woPhone emulator,however I can not compile it anyway …

Does anyone else have an idea on how to fix this? Thank you .

By the way, box2d was also used in my game,but I think it’s none of its bussiness…

Try this:

AppDelegate* p_delegate = (AppDelegate*)&CCApplication::sharedApplication();

GetCurrentApplication() is a member function of TApplication, which is a WoPhone specific class. CCApplication inherites it on WoPhone platform, so you can only use it on WoPhone platform.

I modified my code with Strawberry Milkshake’s advice and it worked. I don’t know why but it worked.