编译脚本

lame 版本

下载完成后 编译 生成

include

lib

两个文件夹

直接拷贝到 lib 目录下

集成

然后

CMakeList 里面添加头文件路径 不做这一步 后面无法在 C++文件里面include

include(libs/include/lame/lame.h)

更简单的 可以直接添加目录

include_directories(libs/include)

添加静态库链接 这一步忘记了会导致编译报错

add_library(mp3lame STATIC IMPORTED)

set_target_properties(mp3lame

PROPERTIES IMPORTED_LOCATION

${distribution_DIR}/armeabi-v7a/libmp3lame.a)

target_link_libraries( # Specifies the target library.

native-lib

mp3lame

# Links the target library to the log library

# included in the NDK.

${log-lib})

完整的 CMake

# For more information about using CMake with Android Studio, read the

# documentation: https://d.android.com/studio/projects/add-native-code.html

# Sets the minimum version of CMake required to build the native library.

cmake_minimum_required(VERSION 3.4.1)

set(distribution_DIR ../../../../libs)

include_directories(libs/include)

# Creates and names a library, sets it as either STATIC

# or SHARED, and provides the relative paths to its source code.

# You can define multiple libraries, and CMake builds them for you.

# Gradle automatically packages shared libraries with your APK.

add_library( # Sets the name of the library.

native-lib

# Sets the library as a shared library.

SHARED

# Provides a relative path to your source file(s).

src/main/cpp/native-lib.cpp)

# Searches for a specified prebuilt library and stores the path as a

# variable. Because CMake includes system libraries in the search path by

# default, you only need to specify the name of the public NDK library

# you want to add. CMake verifies that the library exists before

# completing its build.

find_library( # Sets the name of the path variable.

log-lib

# Specifies the name of the NDK library that

# you want CMake to locate.

log)

# Specifies libraries CMake should link to your target library. You

# can link multiple libraries, such as libraries you define in this

# build script, prebuilt third-party libraries, or system libraries.

target_link_libraries( # Specifies the target library.

native-lib

mp3lame

# Links the target library to the log library

# included in the NDK.

${log-lib})

add_library(mp3lame STATIC IMPORTED)

set_target_properties(mp3lame

PROPERTIES IMPORTED_LOCATION

${distribution_DIR}/armeabi-v7a/libmp3lame.a)

CMake编译

needed by错误

一定是路径设置不对

.a文件呢或者.so文件设置不对

总结出,NDK 中引入别的库

下载库 交叉编译库 .a .so 不一定要编译,也可以源码代入

导入 AndroidStudio,编写 CMake,导入头文件

编译相关源代码

build 出相应的 so

参考

android如何编译lame,Android 编译 Lame 库心路历程相关推荐

  1. Unbuntu环境编译 Android平台可用ffmpeg(带三方库fdk-aac和lame)

    零.准备 编译环境:Ubuntu16.0.4 NDK版本:android-ndk-r21c-linux-x86_64 ffmpeg版本:4.4.1 fdk-aac: fdk-aac-2.0.2 lam ...

  2. 【Android APT】编译时技术 ( 编译时注解 和 注解处理器 依赖库 )

    文章目录 一.编译时注解和注解处理器 二.创建 编译时注解 和 注解处理器 三.添加 编译时注解 和 注解处理器 依赖库依赖 四.博客资源 一.编译时注解和注解处理器 上一篇博客 [Android A ...

  3. arch linux arm下载_linux系统下编译给android JNI调用的Gmssl库

    编译给android JNI调用的Gmssl库的方法,网络上并不多.按照叶大强(CSDN账号:hkNaruto)写的<GmSSL Android NDK编译 (版本95c0dba>的帖子编 ...

  4. android so 不能编译进,Android Studio下编译LatinIME so库CMake版

    编译环境 Android Studio 3.1.3 gradle 4.4-all cmake (sdk目录下) ndk-bundle (sdk目录下) 源码 Android 8.1 (1) packa ...

  5. osg android 库的编译与例子编译-师占标-专题视频课程

    osg android 库的编译与例子编译-4260人已学习 课程介绍         1.教大家如何编译osg3.2的库及cygwin 的编译方式 2.教大家如何编译osg3.4的库及cmake的编 ...

  6. android编译.a文件,Android 7.1源码编译导入AS完整教程

    本教程仅针对Android 7.1系统,为便于虚拟机备份和出现问题时的还原,本教程分为3步:初始化编译环境.源码同步.编译源码导入Android Studio. 编译源码:Android7.1.2_r ...

  7. 【Android 逆向】Android 逆向通用工具开发 ( Android 平台运行的 cmd 程序类型 | Android 平台运行的 cmd 程序编译选项 | 编译 cmd 可执行程序 )

    文章目录 一.Android 平台运行的 cmd 程序类型 二.Android 平台运行的 cmd 程序编译选项 三.编译 Android 平台的 cmd 可执行程序 一.Android 平台运行的 ...

  8. 【Android 逆向】Android 进程注入工具开发 ( 编译注入工具 | 编译结果文件说明 | 注入过程说明 )

    文章目录 一.编译注入工具 二.编译结果文件说明 三.注入过程说明 一.编译注入工具 在 Visual Studio 2019 中打开了一个 " 生成文件项目 " , 该项目就是注 ...

  9. 【Android 插件化】VirtualAppEx 编译运行 ( VirtualAppEx 简介 | 配置 VirtualAppEx 编译环境 | 编译运行 VirtualAppEx 代码 )

    文章目录 一.VirtualAppEx 简介 二.配置 VirtualAppEx 编译环境 1.Android Studio 3.0 2.NDK 版本 ( Android NDK r10e ) 3.配 ...

最新文章

  1. 文巾解题 994. 腐烂的橘子
  2. ConcurrentLInkedQueue队列
  3. 移动端material风格日期时间选择器
  4. android art虚拟机安装,Android中art虚拟机启动流程
  5. [python3 - TroubleShooting] requests爬取中文网站后直接print,以及保存csv乱码
  6. pycharm里怎么关闭一个项目_【周末分享】一个完整的项目复盘到底要怎么做?...
  7. 如何在 Visual Studio 2019 中连接中国版 Azure
  8. ES6 中的 Set、Map 和 WeakMap
  9. 如何自定义容器网络?- 每天5分钟玩转 Docker 容器技术(33)
  10. 投简历没回音?你没写到点子上,HR当然不看
  11. 20春计算机应用基础在线作业,19春学期《计算机应用基础》在线作业21.txt
  12. 如何把一个软件嵌入另一个软件_Notion可不只是一个笔记软件
  13. 技术沙龙 | Android应用之插件化
  14. JAVA轻量级ORM框架JOOQ体验
  15. 拦截mysql执行计划数据_MySQL执行计划详解
  16. 动态时钟html代码_超炫酷的时钟软件推荐
  17. Eviews建立Var模型1
  18. 如何使用python实现翻转英文句子的单词顺序
  19. 4G 优盘格式化后变4M 利用量产工具修复~~~
  20. uni-app 99群公告推送功能(一)

热门文章

  1. 【Matlab】绘制不同颜色线条
  2. 3.5 将 Batch 拟合进神经网络-深度学习第二课《改善深层神经网络》-Stanford吴恩达教授
  3. 3.1 再论 0/1 分类问题-机器学习笔记-斯坦福吴恩达教授
  4. Sphinx+gitee+Read the Docs搭建在线文档系统
  5. 【PC工具】PhotoScape简单好用绿色免费功能强大的照片编辑器(文章评论小程序测试)...
  6. 【三维重建】基于切片的三维重建MATLAB仿真
  7. C++ 之常对象,常对象成员
  8. Scrum立会报告+燃尽图(十一月十八日总第二十六次):功能开发与讨论贡献分配规则...
  9. SpringCloud实践分享-日志收集Kafka-ELK
  10. Android seLinux 设置