a cpp file:
#include <iostream>
#include <jni.h>
#include "Hello.h"
#include "windows.h"
#include "stdafx.h"
typedef void(__stdcall *Print_)();
int main(){
HINSTANCE hDll; //DLL句柄
Print_ print_; //函数指针
hDll = LoadLibrary("Hello.dll");
if (hDll != NULL)
{
print_ = (Print_)GetProcAddress(hDll,"Java_Hello_sayHello@8");
if(print_!=NULL)
{
print_();
}
FreeLibrary(hDll);
}
return 0;
}
//there is something wrong, it prints: http://i983.photobucket.com/albums/ae311/keatingWang/c_wrong.png 未声明的标识符 means : Undeclared identifier