3

I have the following Android.mk...

LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := Box2D-local
LOCAL_SRC_FILES := $(LOCAL_PATH)/../Box2D/libs/$(TARGET_ARCH_ABI)/libbox2D.so
include $(PREBUILT_SHARED_LIBRARY)
include $(CLEAR_VARS)
LOCAL_MODULE    := openbox
LOCAL_C_INCLUDES := $(LOCAL_PATH)/.. $(LOCAL_PATH)
NDK_OUT :=../../
LOCAL_SRC_FILES := \
$(subst $(LOCAL_PATH)/,, \
$(wildcard $(LOCAL_PATH)/*.cpp) \
    $(wildcard $(LOCAL_PATH)/Collision/Shapes/*.cpp))
LOCAL_LDLIBS := -lm -llog -ldl -lGLESv1_CM
LOCAL_SHARED_LIBRARIES := Box2D-local
include $(BUILD_SHARED_LIBRARY)

Everything compiles fine but when I run the application I see....

D/dalvikvm(14851): Trying to load lib /data/app-lib/com.lmdig.android.tutorial.oglbox2dbasics-1/libopenbox.so 0x40ce7138

E/dalvikvm(14851): dlopen("/data/app-lib/com.lmdig.android.tutorial.oglbox2dbasics-1/libopenbox.so") failed: Cannot load library: soinfo_link_image(linker.cpp:1635): could not load library "libbox2D.so" needed by "libopenbox.so"; caused by load_library(linker.cpp:745): library "libbox2D.so" not found

But when I ls the /data/app-lib/com.lmdig.android.tutorial.oglbox2dbasics-1/ folder on the device I see...

root@android:/ # ls /data/app-lib/com.lmdig.android.tutorial.oglbox2dbasics-1/
libbox2D.so
libopenbox.so

Is my LOCAL_SRC_FILES wrong or something?

4

1 回答 1

3

看起来我想当我将它加载到另一个类中时,它会用于这个类。这个假设是不正确的,我不得不在类中加载这两个库。

于 2013-07-10T15:19:24.660 回答