How to build an shared library and call it in other ndk program

前端 未结 2 738
情歌与酒
情歌与酒 2020-12-16 14:53

I want to build an shared library. To build it, I need to call another shared library. Here is what I did:

1.Create one Android project,named \"BuildLib\",and add a

2条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-16 14:57

    In your second Android.mk, try replacing the first module with:

    LOCAL_PATH := $(call my-dir)
    include $(CLEAR_VARS)
    LOCAL_SRC_FILES := libadd.so
    LOCAL_MODULE := add_prebuilt
    LOCAL_EXPORT_C_INCLUDES := add.h
    include $(PREBUILD_SHARED_LIBRARY)
    

    The LOCAL_EXPORT_C_INCLUDES flag should attach the header information to the add_prebuilt module, so it can be linked with your final library.

提交回复
热议问题