我面临一个奇怪的问题。我正在为我的 Android 应用程序构建一个共享库。
我不能同时构建 armv5 和 armv7。如果这样做,在第二次运行时(当 ndk 构建 armV7 库时)我的源文件会出现很多错误,例如:
FinderPatternInfo.o: previous definition here
multiple definition of ...
我的应用程序.mk
APP_ABI := armeabi armeabi-v7a
APP_PLATFORM := android-8
APP_STL := stlport_static
APP_CPPFLAGS += -fexceptions
如果我只设置 APP_ABI := armeabi 或 APP_ABI := armeabi-v7a..
任何想法 ?谢谢您的帮助,
编辑:Android.mk
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := MyModule
MY_LOCAL_INCLUDED_FILES += $(wildcard $(LOCAL_PATH)/*.h)
MY_LOCAL_INCLUDED_FILES += $(wildcard $(LOCAL_PATH)/*.hpp)
MY_LOCAL_INCLUDED_FILES += $(wildcard $(LOCAL_PATH)/bigint/*.h)
... (many includes)
LOCAL_C_INCLUDES := $(subst jni/, , $(MY_LOCAL_INCLUDED_FILES))
MY_LOCAL_SRC_FILES += $(wildcard $(LOCAL_PATH)/*.c)
MY_LOCAL_SRC_FILES += $(wildcard $(LOCAL_PATH)/*.cpp)
MY_LOCAL_SRC_FILES += $(wildcard $(LOCAL_PATH)/bigint/*.c)
.... (many cpp files)
LOCAL_SRC_FILES := $(subst jni/, , $(MY_LOCAL_SRC_FILES))
LOCAL_CFLAGS := -DNO_ICONV
include $(BUILD_SHARED_LIBRARY)