当前位置:网站首页>【混合编程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
太多了就不拷贝了
总结:
这节基本上没什么特殊的东西,主要还是为了说一下这个工具
工具的具体使用官网都有,自己看着试着谢谢就行了,没啥
边栏推荐
- 线性模型LN、单神经网络SNN、深度神经网络DNN与CNN测试对比
- vulnhub之DC9
- In 2022, where will the medium and light-weight games go?
- 亿级月活全民K歌Feed业务在腾讯云MongoDB中的应用及优化实践
- MATLAB and MySQL database connection and data exchange (based on ODBC)
- curl: (35) LibreSSL SSL_ connect: SSL_ ERROR_ SYSCALL in connection
- How SAP Spartacus default routing configuration works
- Flutter 中 ValueNotifier<List<T>> 监听问题解决
- DLA model (classification model + improved segmentation model) + deformable convolution
- About appium trample pit: encountered internal error running command: error: cannot verify the signature of (solved)
猜你喜欢

Module 5 operation

Godson China Science and technology innovation board is listed: the market value is 35.7 billion yuan, becoming the first share of domestic CPU
![[solution] sword finger offer 15 Number of 1 in binary (C language)](/img/ab/149775ae8ed94464efdf6921c1022a.png)
[solution] sword finger offer 15 Number of 1 in binary (C language)

模块五作业

Implementation of collaborative filtering evolution version neuralcf and tensorflow2

Listing of maolaiguang discipline on the Innovation Board: it is planned to raise 400million yuan. Fanyi and fanhao brothers are the actual controllers

KDD2022 | 基于知识增强提示学习的统一会话推荐系统

Netease Yunxin officially joined the smart hospital branch of China Medical Equipment Association to accelerate the construction of smart hospitals across the country

Leetcode (452) - detonate the balloon with the minimum number of arrows

VB. Net class library (advanced version - 1)
随机推荐
KDD2022 | 基于知识增强提示学习的统一会话推荐系统
Common concurrent testing tools and pressure testing methods
Hands on deep learning pytorch version 3 - Data Preprocessing
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)
打新债注册开户有没有什么风险?安全吗?
大龄程序员的一些出路
Godson China Science and technology innovation board is listed: the market value is 35.7 billion yuan, becoming the first share of domestic CPU
JupyterLab 常用配置
curl: (35) LibreSSL SSL_ connect: SSL_ ERROR_ SYSCALL in connection
SAP Commerce Cloud 项目 Spartacus 入门
BN(Batch Normalization) 的理论理解以及在tf.keras中的实际应用和总结
Can compass open an account for stock trading? Is it safe?
Unity3d plug-in anyportrait 2D bone animation
[leetcode]- linked list-2
MATLAB and MySQL database connection and data exchange (based on ODBC)
模块五作业
Application and Optimization Practice of 100 million level monthly live national karaoke feed service in Tencent cloud mongodb
Pass note 【 dynamic planning 】
Convolutional neural network (CNN) explanation and tensorflow2 code implementation
What are the accounting elements