cocos2d-x 1.0.1-x-0.13.0-beta的Classes文件夹中没有android.mk文件

时间:2012-08-13 09:22:22

标签: android cocos2d-x

我在android cocos2d-x项目中运行build_native.sh时遇到问题。事实证明这是一些链接问题。我创建的cpp文件未编译,因此成为未定义的引用。

这是错误:

SoybeanServer-2:android soybeansoft$ ./build_native.sh 
Using prebuilt externals
make: Entering directory `/Users/soybeansoft/devs/cocos2d-x_1.0/MemeQuiz/android'
SharedLibrary  : libgame.so
./obj/local/armeabi/objs/game_shared/__/__/Classes/AppDelegate.o: In function `AppDelegate::applicationDidFinishLaunching()':
/Users/soybeansoft/devs/cocos2d-x_1.0/MemeQuiz/android/jni/../../Classes/AppDelegate.cpp:111: undefined reference to `MainMenu::scene()'
./obj/local/armeabi/objs/game_shared/__/__/Classes/HelloWorldScene.o: In function `HelloWorld::okButtonCallback(cocos2d::CCObject*)':
/Users/soybeansoft/devs/cocos2d-x_1.0/MemeQuiz/android/jni/../../Classes/HelloWorldScene.cpp:179: undefined reference to `Logic::select()'
./obj/local/armeabi/objs/game_shared/__/__/Classes/HelloWorldScene.o: In function `HelloWorld::newQuiz()':
/Users/soybeansoft/devs/cocos2d-x_1.0/MemeQuiz/android/jni/../../Classes/HelloWorldScene.cpp:172: undefined reference to `Logic::getCurrentQuiz()'
/Users/soybeansoft/devs/cocos2d-x_1.0/MemeQuiz/android/jni/../../Classes/HelloWorldScene.cpp:173: undefined reference to `Logic::getCurrentQuiz()'
./obj/local/armeabi/objs/game_shared/__/__/Classes/HelloWorldScene.o: In function `HelloWorld::swipeRight()':
/Users/soybeansoft/devs/cocos2d-x_1.0/MemeQuiz/android/jni/../../Classes/HelloWorldScene.cpp:151: undefined reference to `Logic::nextImage()'
./obj/local/armeabi/objs/game_shared/__/__/Classes/HelloWorldScene.o: In function `HelloWorld::swipeLeft()':
/Users/soybeansoft/devs/cocos2d-x_1.0/MemeQuiz/android/jni/../../Classes/HelloWorldScene.cpp:145: undefined reference to `Logic::previousImage()'
./obj/local/armeabi/objs/game_shared/__/__/Classes/HelloWorldScene.o: In function `~HelloWorld':
/Users/soybeansoft/devs/cocos2d-x_1.0/MemeQuiz/android/jni/../../Classes/HelloWorldScene.cpp:16: undefined reference to `Logic::unregisterEventHandler()'
/Users/soybeansoft/devs/cocos2d-x_1.0/MemeQuiz/android/jni/../../Classes/HelloWorldScene.cpp:30: undefined reference to `LogicEvent::~LogicEvent()'
/Users/soybeansoft/devs/cocos2d-x_1.0/MemeQuiz/android/jni/../../Classes/HelloWorldScene.cpp:16: undefined reference to `Logic::unregisterEventHandler()'
/Users/soybeansoft/devs/cocos2d-x_1.0/MemeQuiz/android/jni/../../Classes/HelloWorldScene.cpp:30: undefined reference to `LogicEvent::~LogicEvent()'
./obj/local/armeabi/objs/game_shared/__/__/Classes/HelloWorldScene.o: In function `HelloWorld':
/Users/soybeansoft/devs/cocos2d-x_1.0/MemeQuiz/android/jni/../../Classes/HelloWorldScene.cpp:9: undefined reference to `Logic::Logic()'
/Users/soybeansoft/devs/cocos2d-x_1.0/MemeQuiz/android/jni/../../Classes/HelloWorldScene.cpp:9: undefined reference to `Logic::Logic()'
./obj/local/armeabi/objs/game_shared/__/__/Classes/HelloWorldScene.o: In function `HelloWorld::imageChanged()':
/Users/soybeansoft/devs/cocos2d-x_1.0/MemeQuiz/android/jni/../../Classes/HelloWorldScene.cpp:161: undefined reference to `Logic::getCurrentImage()'
/Users/soybeansoft/devs/cocos2d-x_1.0/MemeQuiz/android/jni/../../Classes/HelloWorldScene.cpp:162: undefined reference to `MemeImage::setImage(char const*)'
./obj/local/armeabi/objs/game_shared/__/__/Classes/HelloWorldScene.o: In function `HelloWorld::init()':
/Users/soybeansoft/devs/cocos2d-x_1.0/MemeQuiz/android/jni/../../Classes/HelloWorldScene.cpp:83: undefined reference to `MemeImage::MemeImage()'
/Users/soybeansoft/devs/cocos2d-x_1.0/MemeQuiz/android/jni/../../Classes/HelloWorldScene.cpp:90: undefined reference to `Logic::init(float)'
/Users/soybeansoft/devs/cocos2d-x_1.0/MemeQuiz/android/jni/../../Classes/HelloWorldScene.cpp:91: undefined reference to `Logic::registerEventHandler(LogicEvent*)'
/Users/soybeansoft/devs/cocos2d-x_1.0/MemeQuiz/android/jni/../../Classes/HelloWorldScene.cpp:93: undefined reference to `Logic::getCurrentQuiz()'
/Users/soybeansoft/devs/cocos2d-x_1.0/MemeQuiz/android/jni/../../Classes/HelloWorldScene.cpp:94: undefined reference to `Logic::getCurrentQuiz()'
/Users/soybeansoft/devs/cocos2d-x_1.0/MemeQuiz/android/jni/../../Classes/HelloWorldScene.cpp:96: undefined reference to `Logic::getCurrentQuiz()'
/Users/soybeansoft/devs/cocos2d-x_1.0/MemeQuiz/android/jni/../../Classes/HelloWorldScene.cpp:102: undefined reference to `Logic::getCurrentImage()'
/Users/soybeansoft/devs/cocos2d-x_1.0/MemeQuiz/android/jni/../../Classes/HelloWorldScene.cpp:103: undefined reference to `MemeImage::setImage(char const*)'
./obj/local/armeabi/objs/game_shared/__/__/Classes/HelloWorldScene.o:(.data.rel.ro+0x1d0): undefined reference to `typeinfo for LogicEvent'
collect2: ld returned 1 exit status
make: *** [obj/local/armeabi/libgame.so] Error 1
make: Leaving directory `/Users/soybeansoft/devs/cocos2d-x_1.0/MemeQuiz/android'
SoybeanServer-2:android soybeansoft$ 

有些人说我需要列出我在Classes文件夹中的Android.mk文件中创建的所有cpp文件。但在我查看Classes文件夹后,那里没有Android.mk。 那我该如何列出.cpp文件呢?

更新:

我知道jni文件夹中有android.mk文件。但即使我列出了我所有的游戏cpp文件,仍然没有在build_native进程中编译cpp。所以我真的不知道如何列出我的cpp文件。

1 个答案:

答案 0 :(得分:0)

android.mk文件将在eclipse项目的jni文件夹中。看那边。