JNI for native DLL

Discussion in 'Java' started by peru0002, Oct 28, 2010.

  1. peru0002

    peru0002

    Joined:
    Oct 28, 2010
    Messages:
    1
    Likes Received:
    0
    Hi All,

    I am developing through which I need to call some functions from the native DLL.

    Currently, I started an Visual Studio project and an writing an DLL application. Firstly I created a java file and declared the functions there and did a System.loadLibrary(native DLL) there. Then I compiled it using javac and created the jni header file.

    Inside my visual studio project I have the native lib's header file, the newly created jni header file, and I wrote a .cpp file within which for each JNI function I mapped the corresponding functions from the native library. After compiling I have the new DLL.

    Now how do I use this in my java app to call the relevant function? I just did a System.loadLibrary(new DLL) there. But how do I call the functions there?

    I am getting UnsatisfiedLinkError (native method) error? How do I resolve it?

    Regards.
     
    peru0002, Oct 28, 2010
    #1
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Anushi
    Replies:
    5
    Views:
    10,584
  2. Abhishek Singh

    JVM crashes: Native method, JNI

    Abhishek Singh, Jul 23, 2003, in forum: Java
    Replies:
    2
    Views:
    1,034
    Nigel Wade
    Jul 23, 2003
  3. nicolas edel
    Replies:
    5
    Views:
    3,361
    Gordon Beaton
    Jul 31, 2003
  4. Jabel D. Morales - VMan of Mana

    Problems with JNI: calling a Java method from native method.

    Jabel D. Morales - VMan of Mana, Aug 1, 2003, in forum: Java
    Replies:
    1
    Views:
    5,298
    Joseph Millar
    Aug 1, 2003
  5. vasanth
    Replies:
    0
    Views:
    3,260
    vasanth
    Jan 25, 2005
  6. pcarr01
    Replies:
    3
    Views:
    904
    Gordon Beaton
    Feb 17, 2005
  7. bgabrhelik
    Replies:
    0
    Views:
    1,169
    bgabrhelik
    Sep 29, 2009
  8. H. Simpson
    Replies:
    4
    Views:
    625
    H. Simpson
    Aug 3, 2004
Loading...