tags:

views:

243

answers:

3

I am trying to access the function available inside the .dll file. But it give exception like "Exception in thread "main" java.lang.UnsatisfiedLinkError: *.jniGetAudioInputLevel()D". DLL file is loaded but when I try to access the methods it give an error message.

According to my knowledge:-

  • This exception only occurs if the .dll is not in the class path or the dll is not present in the jar file.
  • .dll file is only created if all the code is running with out any error.
  • I have seen the methods in the dll using tools like for example: Anywhere PE Viewer, PE Explorer etc. They both are showing the methods available in the .dll file.

How this in accessibility to the function can be configured out by any other idea?

A: 

Normally we are getting this exception when JVM can't find the .dll file.

Upul
+2  A: 

An UnsatisfiedLinkError is also thrown if the native counterpart to a method declared native can't be found. This can easily happen if the native code was not named with the full Java package name separated using '_'.

For example,

package com.mycompany.stuff;

public native void doSomething();

Requires that a native library (DLL, so, *SRVPGM, etc depending on your system) be found and loaded with System.loadLibrary(), which contains and exports a function named

com_mycompany_stuff_doSomething

If you are certain that the native library is being loaded, my guess is that the function is not correctly named, or is not exported.

Software Monkey
A: 

Check that whether the function name is mentioned properly and try pasting the dll file into the system32 folder of windows...

navinbecse
tat could be the worst idea
rgksugan