cocos2d-x 生成Android远程工程 ./build_native.sh 报错


在Xcode中运行iOS模拟器运行正常
执行 ./build_native.sh 报错信息如下
OS X
Python 2.7.5
cocos2d-x: 2.2.3
工程中调用了Box2D.h

/Users/rahn/Dropbox/Developer/Developer-Kit/android-ndk-r8e/build/core/add-application.mk:128: Android NDK: WARNING: APP_PLATFORM android-14 is larger than android:minSdkVersion 8 in ./AndroidManifest.xml
Compile++ thumb : cocos2dcpp_shared <= AppDelegate.cpp
Compile++ thumb : cocos2dcpp_shared <= HelloWorldScene.cpp
SharedLibrary : libcocos2dcpp.so
/Users/rahn/Dropbox/Developer/Developer-Kit/android-ndk-r8e/toolchains/arm-linux-androideabi-4.6/prebuilt/darwin-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: ./obj/local/armeabi/objs/cocos2dcpp_shared/ / /Classes/HelloWorldScene.o: in function HelloWorld::addBird():jni/../../Classes/HelloWorldScene.cpp:47: error: undefined reference to 'B2Sprite::create(char const )'
/Users/rahn/Dropbox/Developer/Developer-Kit/android-ndk-r8e/toolchains/arm-linux-androideabi-4.6/prebuilt/darwin-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: ./obj/local/armeabi/objs/cocos2dcpp_shared/ / /Classes/HelloWorldScene.o: in function HelloWorld::addBird():jni/../../Classes/HelloWorldScene.cpp:54: error: undefined reference to 'B2Sprite::setPTMRatio(float)'
/Users/rahn/Dropbox/Developer/Developer-Kit/android-ndk-r8e/toolchains/arm-linux-androideabi-4.6/prebuilt/darwin-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: ./obj/local/armeabi/objs/cocos2dcpp_shared/ / /Classes/HelloWorldScene.o: in function HelloWorld::addBird():jni/../../Classes/HelloWorldScene.cpp:55: error: undefined reference to 'B2Sprite::setB2Body(b2Body
)'
collect2: ld returned 1 exit status

cocos2d-x Android

放開那個蘿莉 10 years, 8 months ago

Your Answer