Eclipse CDT + MinGW 生成dll文件

从官网安装MinGW

从market安装CDT插件

将Java\jdk1.7.0_45\include路径下的jni.h和Java\jdk1.7.0_45\include\win32路径下的jni_md.h拷贝到MinGW下的include路径下

环境变量加上MinGW\bin

新建Toolchains是MinGW的C++ empty project

在项目properties 的C\C++ Build—-Settings—-Tool Settings—–MinGW C++ Linker目录栏下的Miscellaneous选项下,在linker flags处填入:-Wl,–add-stdcall-alias,在Shared Library Settings中勾选Shared,Build Arifact选项页中,设置Artifact Type为Shared Library

你可能感兴趣的:(CDT)