Loading JNI .DLL, GCC compiled works, G++ compiled fails
问题 I have a simple JNI .DLL that I am trying to use in a test Java application. It is a .c file that consists of a couple functions, with the header generated by javah . (I am compiling using MinGW btw) If I compile and link this code with GCC, I can load the .DLL just fine with System.loadLibrary(), and use it. If I compiled it with G++ however, loadLibrary() will fail with the dreaded "UnsatisfiedLinkError". This is my GCC line: gcc -Wl,--add-stdcall-alias -I"C:\Program Files (x86)\Java\jdk1.7