Mac OS X -- initWithColor Error

Mac OS X -- initWithColor Error
0.0 0


I have just installed android-ndk-r7 and cocos2d-x on my computer. I modified the and updated the correct path names for the NDK and the ANDROID roots. When I go to run the build_native command on a project I create with the script, everything runs smoothly except for 1 error.

Compile++ thumb : game_logic <= HelloWorldScene.cpp
jni/…/…/Classes/HelloWorldScene.cpp: In member function ‘virtual bool HelloWorld::init()’:
jni/…/…/Classes/HelloWorldScene.cpp:25: error: cannot call member function ‘virtual bool cocos2d::CCLayerColor::initWithColor(const cocos2d::ccColor4B&)’ without object
make: ***** Error 1
bool HelloWorld::init()
// 1. super init first
if ( !CCLayerColor::initWithColor( ccc4(255,255,255,255) ) )
return false;

It is not recognizing the ccc4 object for some reason. Any suggestions?


helloworld needs to inherit cclayercolor instead of cclayer for this to work :

class HelloWorld : public cocos2d::CCLayerColor