java.lang.UnsatisfiedLinkError - native method

Discussion in 'Java' started by andrej.frelih@gmail.com, Nov 13, 2007.

  1. Guest

    java.lang.UnsatisfiedLinkError - native method

    Hello.

    I have one problem regarding the native method compilation.
    I get the following error for ONLY ONE FUNCTION THAT I RECENTLY ADDED:


    Exception in thread "main" java.lang.UnsatisfiedLinkError: helloworld
    at
    com.hp.openview.ib.api.jopc.JOpcApplication.helloworld(Native Method)
    at
    com.hp.openview.ib.api.jopc.JOpcApplication.hellokrava(JOpcApplication.java:
    854)
    at OpcApplication.main(OpcApplication.java:40)


    For example the old function ApplModify and ApplGet work fine.

    One thing that i have noticed when i run nm(prints the list of common
    object names) on the compiled library
    is that my NEWLY added helloworld function contains this "__Fv" at the
    end of the name that is why i think it cannot be found by the java
    class. So i think it is a problem with the library compilation, but i
    don't know where to look.

    ApplGet| 36088|extern|code |$CODE$
    ApplGet| 36088|extern|entry |
    ApplModify| 36232|extern|code |$CODE$
    ApplModify| 36232|extern|entry |
    helloworld__Fv| 36496|extern|entry |
    helloworld__Fv| 36496|extern|code |$CODE$

    Does anyone have an idea please, or needs more information(code
    snapshots).


    Regards,
    Andrej
     
    , Nov 13, 2007
    #1
    1. Advertising

  2. Roedy Green Guest

    On Tue, 13 Nov 2007 06:01:13 -0800, wrote,
    quoted or indirectly quoted someone who said :

    >Does anyone have an idea please, or needs more information(code
    >snapshots).


    See http://mindprod.com/jgloss/sscce.html

    Without the complete code, you are asking your doctor to diagnose the
    causes of your depression from some toenail clippings.

    Next helloworld sounds like an unlikely name for a JNI method. It
    sound much more like the name of a Java class or method.

    You need to compile your C++ with a static library, and wrap it all up
    into a DLL. Check that all three modules are in the same DLL. You
    also need to get the DLL on the path or library path.

    It is possible you have used some dependent C++ library not on the
    path that only one of your modules use.

    Before you post, please make sure your Java follows the caps
    conventions in http://mindprod.com/jgloss/codingconventions.html
    Just a cap or underscore out of place will derail you. C++ will often
    let you make mistakes without telling you.

    Freshly generate your JavaH.

    Review http://mindprod.com/jgloss/jni.html
    to make sure you have not overlooked one of the basics.
    --
    Roedy Green Canadian Mind Products
    The Java Glossary
    http://mindprod.com
     
    Roedy Green, Nov 13, 2007
    #2
    1. Advertising

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. Replies:
    2
    Views:
    819
  2. Delio Nasso
    Replies:
    5
    Views:
    2,155
    Roedy Green
    May 28, 2007
  3. Replies:
    3
    Views:
    752
    Gordon Beaton
    Nov 13, 2007
  4. debapriya.patra
    Replies:
    0
    Views:
    1,035
    debapriya.patra
    Mar 18, 2009
  5. newage
    Replies:
    0
    Views:
    1,135
    newage
    Dec 5, 2010
Loading...

Share This Page