在Windows下面使用cygwin将含有JNI的C文件编译成DLL文件

生成JNI的DLL时提示找不到jni.h的解决办法Cannot open include file: 'jni.h': No such file or directory

在Windows下面:
gcc -mno-cygwin -I/cygdrive/f/Java/jdk1.7.0/include --I/cygdrive/f/Java/jdk1.7.0/include/win32 -Wl,--add-stdcall-alias -shared -o hellojni.dll hellojni.c
 
说明:
  1. #-mno-cygwin 必须填  
  2. #-I表示引入头文件位置  
  3. #-Wl,--add-stdcall-alias 为了防止出现UnsatisfiedLinkError  
​参考:http://ikeepu.com/bar/10171275
 
原文地址:https://www.cnblogs.com/adm1989/p/2849524.html