java调用c++封装的dll

 头文件声明:

  /* Header for class com_service_InvocationService */
#include "jni.h"
#ifndef _Included_com_service_InvocationService
#define _Included_com_service_InvocationService
#ifdef __cplusplus
extern "C" {
#endif
/*
 * Class:     com_service_InvocationService
 * Method:    execute
 */
JNIEXPORT void JNICALL Java_com_service_InvocationService_execute
  (JNIEnv *, jobject, jstring);
{
   //在这里添加任意代码
}

 

cpp文件,实现

 #include <iostream.h>
 #include <string.h>
 #include "com_service_InvocationService.h"

JNIEXPORT void JNICALL Java_com_service_InvocationService_execute
  (JNIEnv *, jobject, jstring)
{
     //在这里添加任意代码
	return;
}



 

你可能感兴趣的:(java,C++,service,header,Class,dll)