title: Call a function of VB DLL file from java using JNA
body: <p>I am new to using JNA.In all what i want to do is use the vb DLL file in java &amp; call the functions from java.
  I created a simple java code for this.</p>
  
  <pre><code>import com.sun.jna.Library;
  import com.sun.jna.Native;
  import com.sun.jna.Platform;
  
  public class Main
  {
      public interface test extends Library
      {
          void fn_Today(int a,int b);
      }
  
      public static void main(String[] args)
      {
          test INSTANCE = (test) Native.loadLibrary(
              (Platform.isWindows() ? "test" : "test"), test.class);
  
          int a = 1;
          int b=2;
  
          INSTANCE .fn_Today(a,b); 
      }
  }
  </code></pre>
  
  <p>When i run this java program i am getting following error-</p>
  
  <pre><code>Exception in thread "main" java.lang.UnsatisfiedLinkError: Error looking up      function 'fn_Today': The specified procedure could not be found.
  
  at com.sun.jna.Function.&lt;init&gt;(Function.java:179)
  at com.sun.jna.NativeLibrary.getFunction(NativeLibrary.java:344)
  at com.sun.jna.NativeLibrary.getFunction(NativeLibrary.java:324)
  at com.sun.jna.Library$Handler.invoke(Library.java:203)
  at com.sun.proxy.$Proxy0.fn_Today(Unknown Source)
  at mwrobel.jna.Main.main(Main.java:27)
  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  at java.lang.reflect.Method.invoke(Method.java:606)
  at com.intellij.rt.execution.application.AppMain.main(AppMain.java:134)
  </code></pre>
  
  <p>Dll code is as</p>
  
  <pre><code>Public Function fn_Today(ival As Integer, ival2 As Integer)
  Dim ret As Integer
  ret = ival + ival2
  
  End Function
  </code></pre>
  
  <p>How can i solved this issue? </p>
  
  <p>i got the following output from dependency walker.</p>
  
  <pre><code>Warning: At least one delay-load dependency module was not found.
  Warning: At least one module has an unresolved import due to a missing  
  export function in a delay-load dependent module.
  </code></pre>