How to include JNI Symbols in your DLL
Firstly, use the magic pragma __declspec(dllexport)
. But this will cause
compiler header mismatches between the header and the source files, unless
you mangle both of them. (Ugly!)
Or otherwise, use the module-definition file:
LIBRARY MYLIB
EXPORTS
Java_com_my_package_ClassName_methodName0
Java_com_my_package_ClassName_methodName1
...
Java_com_my_package_ClassName_methodNameN
And invoke the linker with /def whatever.def
as the command line argument.