我想在我的Android项目中使用本机库,我尝试编译它们。我发现的错误是由不兼容的文件扩展名引起的。它们是.c .h .m4 .y和其他扩展名。
这是我的Android.mk文件的一部分
LOCAL_PATH := $(call my-dir)
TARGET_ARCH_ABI := armeabi-v7a
include $(CLEAR_VARS)
LOCAL_LDLIBS := -llog
LOCAL_MODULE := openssl-0.9.7m
FILE_LIST := $(wildcard $(LOCAL_PATH)/$(LOCAL_MODULE))
LOCAL_SRC_FILES := $(FILE_LIST:$(LOCAL_PATH)/%=%)
include $(BUILD_SHARED_LIBRARY)
include $(CLEAR_VARS)
LOCAL_LDLIBS := -llog
LOCAL_MODULE := pbc-0.5.12
FILE_LIST := $(wildcard $(LOCAL_PATH)/$(LOCAL_MODULE))
LOCAL_SRC_FILES := $(FILE_LIST:$(LOCAL_PATH)/%=%)
include $(BUILD_SHARED_LIBRARY)
include $(CLEAR_VARS)
LOCAL_LDLIBS := -llog
LOCAL_MODULE := libbswabe-0.9
FILE_LIST := $(wildcard $(LOCAL_PATH)/$(LOCAL_MODULE))
LOCAL_SRC_FILES := $(FILE_LIST:$(LOCAL_PATH)/%=%)
include $(BUILD_SHARED_LIBRARY)
include $(CLEAR_VARS)
LOCAL_LDLIBS := -llog
LOCAL_MODULE := gmp-5.0.2
FILE_LIST := $(wildcard $(LOCAL_PATH)/$(LOCAL_MODULE))
LOCAL_SRC_FILES := $(FILE_LIST:$(LOCAL_PATH)/%=%)
include $(BUILD_SHARED_LIBRARY)
include $(CLEAR_VARS)
LOCAL_LDLIBS := -llog
LOCAL_MODULE := libpbc
FILE_LIST := $(wildcard $(LOCAL_PATH)/$(LOCAL_MODULE))
LOCAL_SRC_FILES := $(FILE_LIST:$(LOCAL_PATH)/%=%)
include $(BUILD_SHARED_LIBRARY)
include $(CLEAR_VARS)
LOCAL_LDLIBS := -llog
LOCAL_MODULE := m4-1.4.16
FILE_LIST := $(wildcard $(LOCAL_PATH)/$(LOCAL_MODULE))
LOCAL_SRC_FILES := $(FILE_LIST:$(LOCAL_PATH)/%=%)
include $(BUILD_SHARED_LIBRARY)
include $(CLEAR_VARS)
LOCAL_LDLIBS := -llog
LOCAL_MODULE := cpabe-0.11
FILE_LIST := $(wildcard $(LOCAL_PATH)/$(LOCAL_MODULE))
LOCAL_SRC_FILES := $(FILE_LIST:$(LOCAL_PATH)/%=%)
include $(BUILD_SHARED_LIBRARY)
include $(CLEAR_VARS)
# LOCAL_LDLIBS := -llog
LOCAL_MODULE := PHRapp_Login_JNI
FILE_LIST := $(wildcard $(LOCAL_PATH)/$(LOCAL_MODULE))
LOCAL_SRC_FILES := $(FILE_LIST:$(LOCAL_PATH)/%=%)
include $(BUILD_STATIC_LIBRARY)
当我在Eclipse中编译时,它警告说我在Android.mk中描述的模块有不受支持的源文件扩展名。 我该怎么办?
答案 0 :(得分:0)
使用$wildcard
列出lib构建目录中的所有文件不是一个好习惯。当您使用如此多的开源库时,可以更轻松地为NDK准备和使用 standalone toolchain ,而不是简化Android.mk
。