简体   繁体   中英

How to build static library from C++ using NDK on Android using Android Studio with Gradle?

I have a project written in C++ and I want to build a static library to be able to link against it in other projects. But Android Studio along with NDK produces only shared library objects which are for me not usable (I need static objects). I use gradle plugin to build the code.

While the code compiles I cannot find a way to get a "libname.a" file.

Anybody knows the magic behind this in Gradle ?

While not well familiar with the NDK Gradle supports building native static libraries. You can see an example in C++ with Gradle or learn more about it in gradle user guide Native Binaries chapter .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM