A very short answer: add -Wl,--kill-at or --Wl,--add-stdcall-alias to the
command line. E.g.,
gcc -shared -o hello.dll HelloWorldImp.c -Wl,--kill-at
Check the following for an example (also notice it uses "dllwrap" instead of
Basically, your problem is caused by the (default) way different compilers
handle __stdcall functions. For an explanation, check
Earnie, maybe the JNI problem is worth a section in the FAQ now?
--- Original Message from faraj Meir ---
I'm trying to use the latest mingw to compile a dll that use jni to
communicate with java the problem is that the dll is loaded but jni function
could not be accessed .
This code works well when compiled under visual c++ .
is this a known problem?