我有以下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)
一切都很好,但是当我运行应用程序时,我看到......
D / dalvikvm(14851):尝试加载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”)失败:无法加载库:soinfo_link_image(linker.cpp:1635) ):无法加载“libopenbox.so”所需的库“libbox2D.so”;由load_library引起(linker.cpp:745):找不到库“libbox2D.so”
但是当我在设备上找到/data/app-lib/com.lmdig.android.tutorial.oglbox2dbasics-1/文件夹时,我看到......
root@android:/ # ls /data/app-lib/com.lmdig.android.tutorial.oglbox2dbasics-1/
libbox2D.so
libopenbox.so
我的LOCAL_SRC_FILES是错还是什么?
答案 0 :(得分:3)
看起来我想当我把它加载到另一个类时它会被用于这个。这个假设是不正确的,我不得不在课堂上加载这两个库。