🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.api
Article #1187

UnsatisfiedLinkError

#1187
From: Ranjana Srivastava
Date: Wed, 24 Apr 2002 13:05
34 lines
2105 bytes
I have a dll written in MSVC++4.2 which I need to use from my JAVA application.
I am trying to use JNI from JBuilder5.The application compiles fine but when the execution reaches the point where the native method is called  I get an UnsatisfiedLinkError.
I should also mention here that I can run the same application from the command line without problems.

I have taken the following steps:
1)Added the following lines of code in the java file(RecorderChange.java)
   public native int Square();
    static
  {
       try{
       
        System.loadLibrary("MyDll");
        
      }catch(java.lang.UnsatisfiedLinkError e)
      {
        System.out.println(e.getClass());
        e.printStackTrace();
      }
  }
//Constructor for the RecorderChange class
public RecorderChange() {
        int s = this.Square();//the line of code that throws the 
                              //UnsatisfiedLinkError
        System.out.println(s);
  }
3)Created the .h file using the javah utility
4)Modified signatures in the C++ file and compiled it   
  incorporating the .h file generated in step 4 above.

Am I missing something, what am I doing wrong. Is there something I need to set up in the JBuilder environment before I can use the jni package.
Any help will be appreciated.
Thanks
Ranjana
Technical Details
Message-ID: <3cc6adaa$1_1@dnews>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!cox.net!nntp-relay.ihug.net!newsfeeds.ihug.co.nz!ihug.co.nz!dnews

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 1089d0,ea77a1f746fa520b,start
X-Google-Attributes: gid1089d0,public
X-Google-ArrivalTime: 2002-04-24 06:09:42 PST
From: "Ranjana Srivastava" <rsrivastava@ctchome.com>
Sender: "Ranjana Srivastava" <rsrivastava@ctchome.com>
Reply-To: "Ranjana Srivastava" <rsrivastava@ctchome.com>
Subject: UnsatisfiedLinkError
Newsgroups: borland.public.jbuilder.java.api
X-User-Info: 67.38.73.73 67.38.73.73    
NNTP-Posting-Host: 207.105.83.65
Message-ID: <3cc6adaa$1_1@dnews>
Date: 24 Apr 2002 06:05:46 -0700
X-Trace: dnews 1019653546 207.105.83.65 (24 Apr 2002 06:05:46 -0700)
Lines: 34
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!cox.net!nntp-relay.ihug.net!newsfeeds.ihug.co.nz!ihug.co.nz!dnews