|
【Android】
如何在rk3399上使用第三方静态库
发表于 2018-11-7 16:48:13
浏览:8910
|
回复:0
打印
只看该作者
[复制链接]
楼主
目前手头需要移植一部分静态库到Android上使用,但是移植的时候遇到了问题,在3399上想使用include $(PREBUILT_STATIC_LIBRARY)将第三方静态库编译进来,但是发现根本不生效,完整的mk如下所示:
- LOCAL_PATH := $(call my-dir)
- include $(CLEAR_VARS)
- LOCAL_MODULE := android_native_app_glue_ros
- LOCAL_SRC_FILES := libandroid_native_app_glue.a
- include $(PREBUILT_STATIC_LIBRARY)
- include $(CLEAR_VARS)
- LOCAL_MODULE := test
- LOCAL_SRC_FILES := test.cpp
- LOCAL_C_INCLUDES :=$(LOCAL_PATH)/include
- LOCAL_STATIC_LIBRARIES := android_native_app_glue_ros
- LOCAL_LDLIBS := -landroid
- LOCAL_CPPFLAGS += -fexceptions -frtti
- include $(BUILD_EXECUTABLE)
复制代码 编译后发现在out目录下根本没有生成对应的.a文件,单独编译.a 也发现,不管LOCAL_SRC_FILES设置的静态库文件名是什么,都没有反应,修改的mk如下所示:
- LOCAL_PATH := $(call my-dir)
- include $(CLEAR_VARS)
- LOCAL_MODULE := android_native_app_glue_ros
- LOCAL_SRC_FILES := libandroid_native_app_glue_xxx.a
- include $(PREBUILT_STATIC_LIBRARY)
复制代码 编译的信息也是提示nothing to do, 如下所示:
Starting build with ninja
ninja: Entering directory `.'
ninja: no work to do.
make: Leaving directory `/home/zhang/projects/rk3399'
#### make completed successfully (3 seconds) ####
-------------------------------------------------------------------------------------------------------------------------
以上就是问题描述,希望有解决该问题或者类似问题的大佬不吝赐教。
|
|