I follow the instructions in the Tutorials, everything is OK in the win32 VS2008 environment. But I complie the classes in the cygwin for andorid platform, the error is following:
D:/android/cocos2d-1.0.0-x-0.9.0/simplegame/android/obj/local/Classes/HelloWorld
Scene.o: In function `GameOverScene’:
D:/android/cocos2d-1.0.0-x-0.9.0/simplegame/Classes/GameOverScene.h:22: undefine
d reference to `vtable for GameOverScene’
D:/android/cocos2d-1.0.0-x-0.9.0/simplegame/android/obj/local/Classes/HelloWorld
Scene.o: In function `GameOverScene::node()‘:
D:/android/cocos2d-1.0.0-x-0.9.0/simplegame/Classes/GameOverScene.h:25: undefine
d reference to `GameOverScene::init()’
collect2: ld returned 1 exit status
make: * [/cygdrive/d/android/cocos2d-1.0.0-x-0.9.0/simplegame/android/obj/local/armeabi/libgame.so] Error 1
I check the program very carefully. I found the information in the Chapter 7 - Some Icing on the Cake.
2. The function node() is convenient for developers because of integration of new, init, and autorelease, etc… But there is no keyword like self(objc) in c++, so CCLayer::node() and CCScene::node() should be realized in their derived classes. The realization of node() is similar, we construct two macros to make the realization more essier: LAYER_NODE_FUNC and
SCENE_NODE_FUNC. To use the two macros, init() must be realized in the derived classes.
But everything is completed according to the Port Tips.
This program can run very well in win32, but I meet the error during I complie it into android platform.
error.JPG (95.3 KB)