当前位置:网站首页>【混合编程jni 】第十二篇 jnaerator
【混合编程jni 】第十二篇 jnaerator
2022-06-26 22:01:00 【华为云】
工欲善其事必先利其器,简单的函数我们可以手动的去写,但是复杂的结构体再让我自己写就有点过分了
,这样的生产方式有点低,而且可能写错,毕竟机器比人靠谱
这一节就介绍下JNA的工具jnaerator,将你从繁琐的且复杂的签名中解脱出来
jnaerator 来历
项目地址:GitHub - java-native-access/jna: Java Native Access
JNA 使 Java 程序可以轻松访问本机共享库,无需编写 Java 代码以外的任何内容 - 不需要 JNI 或本机代码。
Java 调用看起来就像本机代码中的调用一样。大多数调用不需要特殊处理或配置;不需要样板文件或生成的代码。
开发人员使用 Java 接口来描述目标本地库中的函数和结构。这使得利用本机平台特性变得非常容易
JNA jar包下载地址: jna -5.10.0.jar jna-jpms-5.10.0.jar
这是 JNA 的核心工件,仅包含绑定库和核心帮助程序类。
JNA平台
jna -platform-5.10.0.jar jna-platform-jpms-5.10.0.jar
该工件包含跨平台映射和许多常用平台功能的映射,包括大量 Win32 映射以及一组简化本机访问的实用程序类。代码经过测试,实用程序接口确保正确处理本机内存管理。
生成接口文件
脚本
java -jar jna-5.10.0.jar \ -runtime JNA \ -mode Directory \ -o jna_code -package com.pdool -f ./library.h ./SSC.h libtestCppJNA.so命令的说明文档:Command Line Options And Environment Variables · nativelibs4java/JNAerator Wiki · GitHub
太多了就不拷贝了
总结:
这节基本上没什么特殊的东西,主要还是为了说一下这个工具
工具的具体使用官网都有,自己看着试着谢谢就行了,没啥
边栏推荐
- Leetcode (452) - detonate the balloon with the minimum number of arrows
- Introduction of classic wide & deep model and implementation of tensorflow 2 code
- Is it safe to open a stock account with the QR code given by the CICC securities manager? I want to open an account
- How to create an OData service with the graphical modeler on the sap BTP platform
- MacOS环境下使用HomeBrew安装[email protected]
- Homebrew installation in MacOS environment [email protected]
- 证券注册开户有没有什么风险?安全吗?
- Configure redis master-slave and sentinel sentinel in the centos7 environment (solve the problem that the sentinel does not switch when the master hangs up in the ECS)
- 网络爬虫终篇:向10万级网易云用户发送定向消息
- leetcode:6107. 不同骰子序列的数目【dp六个状态 + dfs记忆化】
猜你喜欢

YOLOv6:又快又准的目標檢測框架開源啦
![leetcode:1567. 乘积为正数的最长子数组长度【dp[i]表示以i结尾的最大长度】](/img/a4/c5c31de7a0a3b34a188bfec0b5d184.png)
leetcode:1567. 乘积为正数的最长子数组长度【dp[i]表示以i结尾的最大长度】
![leetcode:141. Circular linked list [hash table + speed pointer]](/img/19/f918f2cff9f831d4bbc411fe1b9776.png)
leetcode:141. Circular linked list [hash table + speed pointer]

DLA模型(分类模型+改进版分割模型) + 可变形卷积

Pass note 【 dynamic planning 】

Shiniman household sprint A shares: annual revenue of nearly 1.2 billion red star Macalline and incredibly home are shareholders

Test comparison of linear model LN, single neural network SNN, deep neural network DNN and CNN

Yolov6: the fast and accurate target detection framework is open source

网络爬虫2:抓取网易云音乐评论用户ID及主页地址

VB. Net class library (advanced version - 1)
随机推荐
中金证券经理给的开户二维码办理股票开户安全吗?我想开个户
leetcode:152. Product maximum subarray [consider DP of two dimensions]
Centos7 compiling and installing redis
Unity 设置Material、Shader的方法
Which securities company is the most convenient, safe and reliable for opening an account
Is it safe to buy stocks and open accounts through the account QR code of the CICC securities manager? Want to open an account for stock trading
Parsing complex JSON in fluent
SAP Spartacus 默认路由配置的工作原理
[fundamentals of image processing] GUI image curve adjustment system based on MATLAB [including Matlab source code 1923]
ICML2022 | Neurotoxin:联邦学习的持久后门
Flower shop window layout [dynamic planning]
DLA模型(分类模型+改进版分割模型) + 可变形卷积
Unity3D插件 AnyPortrait 2D骨骼动画制作
LabVIEW Arduino tcp/ip remote smart home system (project part-5)
大龄程序员的一些出路
传纸条【动态规划】
Is there any risk for flush to register and open an account? Is it safe?
Pass note 【 dynamic planning 】
网络爬虫2:抓取网易云音乐评论用户ID及主页地址
360 mobile assistant is the first to access the app signature service system to help distribute privacy and security