包括来自预构建库Android.mk的标题文件
including header files from prebuilt library Android.mk
我使用
将预先构建的库包括include $(PREBUILT_SHARED_LIBRARY)
使用
包括或不包括经过验证的天气库$(modules-get-list)
当我尝试在预构建库中包含一个标头文件时,我将找不到错误标题。以下是我的确切android.mk文件
LOCAL_PATH := $(call my-dir)
# import prebuilt-library
include $(CLEAR_VARS)
LOCAL_MODULE := prebuilt-library
LOCAL_SRC_FILES := ../../../target/dependency/libs/$(TARGET_ARCH_ABI)/libprebuilt.so
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/include
include $(PREBUILT_SHARED_LIBRARY)
# building provider interface library for communication
include $(CLEAR_VARS)
LOCAL_MODULE := library-interface
LOCAL_SRC_FILES := LibraryComminicator.cpp
LOCAL_SHARED_LIBRARIES := prebuilt-library
include $(BUILD_SHARED_LIBRARY)
$(warning Existing modules: "$(modules-get-list)")
# Include the Android Maven plugin generated makefile
# Important: Must be the last import in order for Android Maven Plugins paths to work
include $(ANDROID_MAVEN_PLUGIN_MAKEFILE)
尝试 android.mk 下面:
LOCAL_PATH := $(call my-dir)
EXT_LIB_ROOT := $(LOCAL_PATH)/../../../target/dependency # or whatever
# building provider interface library for communication
include $(CLEAR_VARS)
LOCAL_MODULE := library-interface
LOCAL_SRC_FILES := LibraryComminicator.cpp
LOCAL_SHARED_LIBRARIES := prebuilt-library
include $(BUILD_SHARED_LIBRARY)
# import prebuilt-library
LOCAL_PATH := $(EXT_LIB_ROOT)
include $(CLEAR_VARS)
LOCAL_MODULE := prebuilt-library
LOCAL_SRC_FILES := libs/$(TARGET_ARCH_ABI)/libprebuilt.so
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/include
include $(PREBUILT_SHARED_LIBRARY)
$(warning Existing modules: "$(modules-get-list)")
基本规则是:xxx_include_files应该相对于"当前dir",而local_src_files相对于$(local_path),而不是"当前dir"。使用NDK,通常"当前的dir"为 $(LOCAL_PATH)/..
,但这可能会改变,尤其是 android.mk 文件链接的情况下,即一个包括另一个。
您确实不需要local_path即可使用prebuilt_shared_library模块,但是我更喜欢尽可能短。
相关文章:
- 为什么在Windows上的VS 2019和Clang 9中"size_t"在没有标题的情况下工作
- 对于C++,方括号中的标题必须总是在引号中的标题之上吗
- 库标题在标题中不可见,但在 cmake build 下.cpp文件中完全可见.为什么?
- 为什么我不应该把所有东西都放在标题中?
- WinAPI 检查窗口是否具有常规标题栏
- 如何更改窗体上所有控件的标题?[C++生成器]
- 提升用于解析标题列的精神语法
- 所以我正在为我的学校作业练习继承,但我无法正确实施标题保护
- 如何删除已输入的书以及如何使标题,语言和名称在上面放置空格不会出错?
- 使用类 ?C++ 和 SFML 以及标题中的 15 个字符
- Gtkmm 窗口为空白,不显示任何小部件或标题
- 我将如何在 cpp 中生成一个随机且独特的标题
- std::带有颜色和标题的 clog 包装器无法正确打印整数
- 我在 ndk 中构建文件时遇到错误 android.mk
- 仅提升计时标题与链接
- 是否有理由在标题中保留完全专用的模板?
- 如何在QGroundControl的标题中放置空格?
- 崇高的林特与叮当在标题中找不到头文件
- C++ - 从 MFC 应用程序启动记事本,并将其默认标题从 "Untitled - Notepad" 更改为其他内容
- 包括来自预构建库Android.mk的标题文件