my C++ function uses Windows Libraries... checking Code Blocks, i found out that the Linker uses gdi32.lib, user32.lib and kernel32.lib. the C++ application runs fine by itself (as an .exe).
anyway, when i didnt include the libraries in my CPP project for JNI, it compiles sucessfully. however, when i wanna use the method that does the JNI function, the application gives me the following Exception:
Exception in thread "AWT-EventQueue-0" java.lang.UnsatisfiedLinkError: GUI.RefreshDesktop.refreshDesktop()V
so, i thought i needed to include these libraries in my Java class as well.
class RefreshDesktop{
static{
System.load("libRefreshDesktopCPP.dll"); //don't worry about the pathing. :D
System.load("Gdi32.Lib");
System.load("User32.Lib");
System.load("Kernel32.Lib");
}
public static void refresh(){
new RefreshDesktop().refreshDesktop();
}
private native void refreshDesktop();
}
however, upon execution, i get the Exception:
Exception in thread "AWT-EventQueue-0" java.lang.UnsatisfiedLinkError: Gdi32.Lib: %1 is not a valid Win32 application
when i tried to link these libraries in the Linker in the C++ project, i get errors saying those files cannot be found, even though i used absolute path.
so, how do i make this stuff work?