2013-01-24 38 views
0

我是比較新的CçNDK NDK建造不承認錯誤標題:未定義參考「cpBBTreeNew」

我的工作端口花栗鼠物理引擎到我的項目,但是,當我嘗試運行ndk-建立我得到以下...

/Users/user/Development/Android/android-ndk-r8c/toolchains/arm-linux-androideabi-4.6/prebuilt/darwin-x86/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: ./obj/local/armeabi/objs/chipmunk_shared/src/cpSpace.o: in function cpSpaceInit:jni/src/cpSpace.c:103: error: undefined reference to 'cpBBTreeNew' /Users/user/Development/Android/android-ndk-r8c/toolchains/arm-linux-androideabi-4.6/prebuilt/darwin-x86/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: ./obj/local/armeabi/objs/chipmunk_shared/src/cpSpace.o: in function cpSpaceInit:jni/src/cpSpace.c:104: error: undefined reference to 'cpBBTreeNew' /Users/user/Development/Android/android-ndk-r8c/toolchains/arm-linux-androideabi-4.6/prebuilt/darwin-x86/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: ./obj/local/armeabi/objs/chipmunk_shared/src/cpSpace.o: in function cpSpaceInit:jni/src/cpSpace.c:105: error: undefined reference to 'cpBBTreeSetVelocityFunc'

當我用grep該類我看到...

~/Documents/workspace/Chipmunk$ grep -r cpBBTreeNew jni/ jni//include/chipmunk/cpSpatialIndex.h:cpSpatialIndex* cpBBTreeNew(cpSpatialIndexBBFunc bbfunc, cpSpatialIndex *staticIndex); jni//src/cpBBTree.c:cpBBTreeNew(cpSpatialIndexBBFunc bbfunc, cpSpatialIndex *staticIndex) jni//src/cpSpace.c: space->staticShapes = cpBBTreeNew((cpSpatialIndexBBFunc)cpShapeGetBB, NULL); jni//src/cpSpace.c: space->activeShapes = cpBBTreeNew((cpSpatialIndexBBFunc)cpShapeGetBB, space->staticShapes);

所以我知道.h文件是存在的,我確認這是打通裝另一個。我不認爲這是問題,但這裏是我的Android.mk ...

LOCAL_PATH := $(call my-dir) 

include $(CLEAR_VARS) 

LOCAL_MODULE := chipmunk_shared 

LOCAL_MODULE_FILENAME := libchipmunk 

LOCAL_SRC_FILES := \ 
src/chipmunk.c \ 
.... 
src/cpVect.c 

LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/include/chipmunk 

LOCAL_C_INCLUDES := $(LOCAL_PATH)/include/chipmunk 
LOCAL_CFLAGS := -std=c99 

include $(BUILD_SHARED_LIBRARY) 

########### Static library 

include $(CLEAR_VARS) 

LOCAL_MODULE := chipmunk_static 

LOCAL_MODULE_FILENAME := libchipmunk 

LOCAL_SRC_FILES := \ 
src/chipmunk.c \ 
.... 
src/cpVect.c 

LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/include/chipmunk 

LOCAL_C_INCLUDES := $(LOCAL_PATH)/include/chipmunk 
LOCAL_CFLAGS := -std=c99 

include $(BUILD_STATIC_LIBRARY) 

任何人都可以幫忙嗎?

回答

2

鏈接時缺少cpBBTree.o的聲音。 LOCAL_SRC_FILES是否缺少cpBBTree.c?

+0

良好的通話我有點偷了Android.mk,誰做了它上次沒有它。謝謝! – Jackie

+0

可能更好地打開另一個問題 – Jackie