当前位置:网站首页>ndk编译so库
ndk编译so库
2022-08-05 05:55:00 【shuangrenlong】
1.android studio 在sdk 设置里面选中ndk版本下载
ndk开发我们此处下载的版本是21.0.6113669
android stuido的local.properties需要配置sdk和ndk路径
例如
sdk.dir=C\:\\Sdk
ndk.dir=C\:\\Sdk\\ndk\\21.0.6113669
2.配置ndk环境变量Path 只要指向ndk-build.cmd 文件的目录
3.检查ndk环境是否配置好 cmd命令: ndk-build -v
GNU Make 4.2.1
Built for x86_64-w64-mingw32
Copyright (C) 1988-2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software:you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
表示环境已经配置好
4.编译库
第一种方法,把文件放入工程app模块 和java平级的目录jni里面。。jni不要再放一个文件夹包起来,然后进入这个目录
例如 e: 进入E盘 cd E:\jni 进入了目录 然后执行命令 ndk-build 就会生成so库了
如果不成功,看下报错是什么。。是不是文件的目录不对,再调整
放入工程其实主要是方便看文件里面的内容 ,方便修改
第二种方法其实跟第一种一样。就是不放进工程。直接命令进入目录(无需修改为jni),执行ndk-build就行了,就会生成so文件了,每个cpp文件都会生成一个so文件
亲测可以生成没有问题
可以看下
边栏推荐
- Media query, rem mobile terminal adaptation
- Chengyun Technology was invited to attend the 2022 Alibaba Cloud Partner Conference and won the "Gathering Strength and Going Far" Award
- Writing OpenCV in VSCode
- 2022最强版应届生软件测试面试攻略
- VSCode编写OpenCV
- Promise (三) async/await
- 多用户商城多商户B2B2C拼团砍价秒杀支持小程序H5+APP全开源
- D46_Force applied to rigid body
- js判断文字是否超过区域
- numpy.random使用文档
猜你喜欢
随机推荐
Q 2020, the latest senior interview Laya soul, do you know?
Promise (三) async/await
Chengyun Technology was invited to attend the 2022 Alibaba Cloud Partner Conference and won the "Gathering Strength and Going Far" Award
摆脱极域软件的限制
MyCat安装
Come, come, let you understand how Cocos Creator reads and writes JSON files
【内推】新相微电子
lingo入门——河北省第三届研究生建模竞赛B题
MyCat配置文件
## 简讲protobuf-从原理到使用
MySQL的主从模式搭建
Redis的使用
LaTeX image captioning text column automatic line wrapping
System basics - study notes (some command records)
开源中国活动合作说明书
MySQL表操作练习
利用将网页项目部署到阿里云上(ngnix)
字体样式及其分类
reduce()方法的学习和整理
numpy.random usage documentation









