如何为包括另一NDK项目静态库? [英] How to include static library in another ndk project?

查看:96
本文介绍了如何为包括另一NDK项目静态库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建静态库说libABC.a。现在我想在JNI层的其他Android项目使用这个静态库。第二个项目也将有JNI文件夹中自己的.cpp文件,其中将使用libABC.a静态库的功能。现在的问题是什么,通过它我可以包括静态库成JNI层的其他项目的步骤?

I have created static library of one of my project say libABC.a. Now i want to use this static library in another android project at jni layer. The second project would also have its own .cpp files inside jni folder, which would be using the functions of libABC.a static library. Now my question is what are the steps through which i can include static library into another project at jni layer ?

推荐答案

您可以在Android.mk文件中使用 preBUILT_STATIC_LIBRARY

You can use PREBUILT_STATIC_LIBRARY in your Android.mk file.

他们有一个很详细的说明 Android的NDK /文档/ preBUILT.xml

They have a very detailed explanation in android-ndk/docs/PREBUILT.xml

总之你添加到您的Andr​​oid.mk像

In short you add to your Android.mk something like

include $(CLEAR_VARS)
LOCAL_MODULE := anynamehere
LOCAL_SRC_FILES := yourlib.a
include $(PREBUILT_STATIC_LIBRARY)

您模块之前

这篇关于如何为包括另一NDK项目静态库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆