LOCAL_PATH:= $(call my-dir)
common_SRC_FILES := xglmk.c  glib.c   common_C_INCLUDES += $(LOCAL_PATH)/include
include $(CLEAR_VARS)LOCAL_SRC_FILES := $(common_SRC_FILES)
LOCAL_C_INCLUDES += $(common_C_INCLUDES)
LOCAL_SHARED_LIBRARIES += $(common_SHARED_LIBRARIES)
LOCAL_MODULE:= libxglmk
include $(BUILD_SHARED_LIBRARY)
include $(CLEAR_VARS)
LOCAL_SRC_FILES := $(common_SRC_FILES)
LOCAL_C_INCLUDES += $(common_C_INCLUDES) 
LOCAL_SHARED_LIBRARIES += $(common_SHARED_LIBRARIES)
LOCAL_MODULE:= libxgl 
LOCAL_LDLIBS    += -landroid -lz  -L$(LOCAL_PATH) -lcommon
include $(BUILD_SHARED_LIBRARY)
外加一个另外一个工程生成的libcommon.so,已经拷贝至armeabi目录下了 也查看设备的lib目录也生成了可是加载libcommon.so时老提示失败编译没出错 运行时报错了

解决方案 »

  1.   

    这个跟搜索路径有关  你用的是LOCAL_LDLIBS运行时搜索的时/system/lib/这个路径 所以找不到
    LOCAL_LDLIBS
        The list of additional linker flags to be used when building your
        module. This is useful to pass the name of specific system libraries
        with the "-l" prefix. For example, the following will tell the linker
        to generate a module that links to /system/lib/libz.so at load time:
    已经在lib目录下可以先System.loadLibrary("common")加载进来  运行时候就可以找到了