//testdll.h
/* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h>
/* Header for class testdll */
#ifndef _Included_testdll
#define _Included_testdll
#ifdef __cplusplus extern "C" {
#endif
/*
* Class: testdll
* Method: get
* Signature: ()I
*/
JNIEXPORT jint JNICALL Java_testdll_get(JNIEnv *, jclass);
/*
* Class: testdll
* Method: set
* Signature: (I)V
*/
JNIEXPORT void JNICALL Java_testdll_set(JNIEnv *, jclass, jint);
#ifdef __cplusplus
}
#endif
#endif
//testdll.java
public class testdll
{
static
{
System.loadLibrary("testdll");
}
public native static int get();
public native static void set(int i);
public static void main(String[] args)
{
testdll test = new testdll();
test.set(10);
System.out.println(test.get());
}
} gcc -Wl,--add-stdcall-alias -I "C:\Program Files\Java\jdk1.6.0_39\include" -I "C:\Program Files\Java\jdk1.6.0_39\include\win32" -shared -o testdll.dll testdll.cpp
//testdll.cpp
#include "testdll.h"
int i = 0;
JNIEXPORT jint JNICALL Java_testdll_get(JNIEnv *, jclass)
{
return i;
} JNIEXPORT void JNICALL Java_testdll_set(JNIEnv *, jclass, jint j)
{
i = j;
}

  

  

最新文章

  1. PHOG特征
  2. dynamics_cast&lt;&gt;
  3. [转]Try Cloud Messaging for Android
  4. Shortest Word Distance
  5. 使GridView可以单行横向滑动
  6. iOS获取汉字的拼音
  7. Java中类的初始化
  8. CF Codeforces Round #258 (Div. 2) B (451B)
  9. Ubuntu 用 pptp 建立 vpn 服务
  10. ##DAY6 UIScrollView
  11. 加密代理和Retrofit解密Converter
  12. 升鲜宝V2.0_生鲜配送行业,对生鲜配送系统开发与实施的深度对比与思考_升鲜宝生鲜配送系统_15382353715_余东升
  13. python学习第三次记录
  14. BZOJ3601 一个人的数论 莫比乌斯反演、高斯消元/拉格朗日插值
  15. js 日期 相关
  16. HTTPConnectionPool(host=&#39;xx.xx.xx.xx&#39;, port=xx): Max retries exceeded with url:(Caused by ConnectTimeoutError(&lt;urllib3.connection.HTTPConnection object at 0x0000015A25025EB8&gt;...))
  17. centos7下安装docker(13.2容器数据共享)
  18. 第01章 准备工作.md
  19. Mysql group_concat函数列转行,与行转列
  20. 【Python入门学习】列表生成和函数生成器的方式实现杨辉三角

热门文章

  1. SAP ABAP 日期相关函数
  2. Find发帖水王哥
  3. Android中使EditText失去焦点,edittext禁止弹出键盘[转]
  4. SQL高级优化之经常使用的优化策略-2(The Return Of The King)
  5. 使用QEMU调试Linux内核代码
  6. [置顶] String StringBuffer StringBuilder的区别剖析
  7. 精《记叙“tom”4年的软件开发之旅》
  8. RedHat7笔记
  9. X86(32位)与X64(64位)有什么区别,如何选择对应的操作系统和应用程序?
  10. eAccelerator介绍