Android.mk中引用第3方动态库

论坛 期权论坛 编程之家     
选择匿名的用户   2021-6-2 16:08   981   0

Android.mk 文件内容:

LOCAL_PATH:= $(call my-dir)

include $(CLEAR_VARS)

LOCAL_MODULE_TAGS := optional

LOCAL_SRC_FILES:= \
  testH264VideoStreamer.cpp


LOCAL_MODULE := live555_stream
LOCAL_MODULE_CLASS := EXECUTABLES
LOCAL_STATIC_LIBRARIES := libcutils libc

LOCAL_C_INCLUDES += $(LOCAL_PATH)/liveMedia/include \
             $(LOCAL_PATH)/groupsock/include \
             $(LOCAL_PATH)/UsageEnvironment/include \
             $(LOCAL_PATH)/BasicUsageEnvironment/include


LOCAL_SHARED_LIBRARIES := \
            libcutils libutils


#LOCAL_SHARED_LIBRARIES := liblive555
LOCAL_LDFLAGS += $(LOCAL_PATH)/liblive555.so

#LOCAL_STATIC_LIBRARIES += libstlport_static libstdc++ libm libc

include $(BUILD_EXECUTABLE)

注意: 引用第三方动态库*.so, 不能用LOCAL_SHARED_LIBRARIES := liblive555这种方式,否则会报错:

make: *** No rule to make target `out/target/product/rk312x/obj/SHARED_LIBRARIES/liblive555_intermediates/export_includes', needed by `out/target/product/rk312x/obj/EXECUTABLES/live555_stream_intermediates/import_includes'. Stop.

只有系统的库,才能这样引用。切记!

文件目录结构:

这个问题郁闷我半个多小时,特此写下来,与大家共享,也算是记了笔记了。

转载于:https://www.cnblogs.com/Jade2009/p/5667899.html

分享到 :
0 人收藏
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

积分:3875789
帖子:775174
精华:0
期权论坛 期权论坛
发布
内容

下载期权论坛手机APP