我正在将 gnustl_static 添加到外部 Android 模块,并且在构建它时出现以下错误。
make: *** No rule to make target `prebuilt/ndk/android-ndk-r7/sources/cxx-stl/gnu-libstdc++/libs/armeabi-v7a/libstdc++.a', needed by `out/target/product/msm8960/obj/SHARED_LIBRARIES/liballjoyn_intermediates/LINKED/liballjoyn.so'. Stop.
当我查看“prebuilt/ndk/android-ndk-r7/sources/cxx-stl/gnu-libstdc++/libs/armeabi-v7a/”时,我找不到 libstdc++.a 有一个 fild libsupc++.a
构建系统正在从它声明的“build/core”文件夹中的 binary.mk 文件中获取它
# LOCAL_NDK_STL_VARIANT is gnustl_static
my_ndk_stl_include_path := $(my_ndk_source_root)/cxx-stl/gnu-libstdc++/libs/$(TARGET_CPU_ABI)/include \
$(my_ndk_source_root)/cxx-stl/gnu-libstdc++/include
my_ndk_stl_static_lib := $(my_ndk_source_root)/cxx-stl/gnu-libstdc++/libs/$(TARGET_CPU_ABI)/libstdc++.a
问题是我不知道如何克服这个错误。
预建文件夹中有许多 libstdc++ 副本,但在列出的位置中找不到它们。发现于
prebuild/ndk/$(ANDRIOD_NDK_VERSION)/platforms/$(ANDROID_SDK_VERSION)/$(ARCHETECTURE_TYPE)/usr/lib/libstdc++.a
这是我的 Android.mk 文件的缩写形式:
LOCAL_PATH := $(call my-dir)
# Rules to build libabc.so
include $(CLEAR_VARS)
LOCAL_CPP_EXTENSION := .cc
LOCAL_SDK_VERSION := 8
LOCAL_NDK_VERSION := 7
LOCAL_NDK_STL_VARIANT := gnustl_static
LOCAL_CFLAGS += \
-std=gnu++0x
LOCAL_C_INCLUDES := \
external/abc/inc \
external/openssl/include
LOCAL_SRC_FILES := \
file1.cc \
file2.cc
LOCAL_SHARED_LIBRARIES := \
libcrypto \
libssl \
liblog
LOCAL_PRELINK_MODULE := false
LOCAL_REQUIRED_MODULES := \
external/openssl/crypto/libcrypto \
external/openssl/ssl/libssl
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE := libabc
include $(BUILD_SHARED_LIBRARY)
任何人都知道如何解决“无规则制定目标”构建问题?