当前位置: 首页 > news >正文

宝安国内知名网站建设比较好的本机网络ip做网站

宝安国内知名网站建设比较好的,本机网络ip做网站,广州网站开发 细致广州亦客网络,有哪些网站可以做设计挣钱一、CMake工具的介绍 如图所示#xff0c;CMake工具的主要作用是#xff0c;将C/C编写的native源文件编译打包生成库文件#xff08;包含动态库或者静态库文件#xff09;#xff0c;集成到Android中使用。 二、CMake编译工具的使用 使用主要是配置两个文件#xff1a;CM… 一、CMake工具的介绍 如图所示CMake工具的主要作用是将C/C编写的native源文件编译打包生成库文件包含动态库或者静态库文件集成到Android中使用。 二、CMake编译工具的使用 使用主要是配置两个文件CMakeList.txt和build.gradle 1、CMakeList.txt介绍 文件路径如下 文件默认的内容如下没加#号的都是配置 cmake_minimum_required(VERSION 3.22.1)# Declares and names the project.project(testnative)# 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.testnative# Sets the library as a shared library.SHARED# Provides a relative path to your source file(s).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.testnative# Links the target library to the log library# included in the NDK.${log-lib}) 1.cmake_minimum_required(VERSION 3.22.1) 表示项目支持的最低cmake工具版本是3.22.1 2. add_library( # Sets the name of the library.testnative# Sets the library as a shared library.SHARED# Provides a relative path to your source file(s).native-lib.cpp) 表示的是添加库定义生成的库的名称、类型、指定的源码 testnative就是指定库的名称 SHARED就是指定生成库的类型动态|静态 native-lib.cpp就是要编译的源码的相对CMakeList.txt的路径相对路径 3. 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) 表示引入库这里是指定了ndk里面的log库并将库的路径赋值给了log-lib变量相当于java中定义了一个变量log-lib值是log。 4. target_link_libraries( # Specifies the target library.testnative# Links the target library to the log library# included in the NDK.${log-lib}) 就是链接库。将特定库链接到目标库这是是将上面定义的log-lib链接到我们的testnative这里的${log-lib}就是将log-lib的值取出来链接到我们的testnative这样我们就可以使用log库了。 2、module下的build.gradle配置了CMake的介绍 文件路径如下 打开文件看下如下配置 CMake在android{}闭包中做了如下配置 externalNativeBuild {cmake {path file(src/main/cpp/CMakeLists.txt)version 3.22.1}} 这里这个配置配置了CMakeList.txt文件的路径路径是相对于项目的和编译使用的cmake的版本。 另外我们还可以在defaultConfig闭包下配置其他信息C/C标准库的支持版本如下 上面这个配置可以不写使用默认的就行。以下是一个配置样例 这里配置的C标准库是动态类型静态库就不需要指定这样编译后会在build中生成一个标准库文件。 加之前的是 加之后的是 这里顺便介绍一下C标准库是什么 三、Android中如何生成的so库 以上代码就能将so库加载到程序中然后就可以调用相关的native的api从而就基于JNI来调用so库里面的功能。 编写相关的代码 在Java端我们编写一个native的方法 对应到C/C中的代码就是 Java端通过调用stringFromJNI()就能调用到C/C端的这段代码这就是JNI的使用。 效果Android界面显示了C函数中的字符串。
http://www.hkea.cn/news/14534251/

相关文章:

  • 网站设计流程及制作流程dede移动端网站源码
  • 淘宝网站建设目标是什么意思建设网站 费用吗
  • 老网站改版做别的中国最早做网站是谁
  • 企业网站建设用标语涿州做软件和网站的
  • 户外媒体网站建设免费世界比分榜
  • 可以做锚文本链接的网站北京网站建设yi wl
  • 响应式设计的网站室内设计模拟app
  • 淘宝网页版怎么看直播烟台网站建设方案优化
  • 杭州余杭区网站建设营销方案包括哪些内容
  • python3 网站开发入门济南网站建站推广
  • 专业建站公司的业务内容asp网站源码免费版
  • 万网域名备案网站做网站市场报价
  • 郑州旅游网站设计东莞搜索seo网站关键词优化
  • 有哪些网站可以用网站做排行多少费用
  • 已有网站开发app终端手机网站建好怎么发布
  • 怎样围绕网站专题发展来做ppt天津港电子商务网
  • 杭州网站建设很 棒大中小网站的区分
  • 诸城哪有做公司网站的百度文库首页官网
  • 做百度推广是不是得有个网站先商丘市网络优化公司地址
  • 做网站公司赚不赚钱网站视频与服务器的关系
  • win2012做网站app介绍视频模板
  • 注册网站免费注册ins域名查ip地址查询
  • 外贸没有公司 如何做企业网站网站代码建设 实例
  • 营销型网站建设 网络服务上海网站推广优化
  • 亚太建设科技信息研究院网站wordpress页面关联目录
  • 如何让网站收录公司名舟山seo网络优化招聘
  • wordpress去顶部文字山东seo费用多少
  • 网站改版后百度不收录微信推广图片
  • 部门定制网站建设公司跨境电商东莞网站建设
  • 优秀网站界面设计建盏的好处