Article View: borland.public.jbuilder.java.api
Article #2375JNI Link Error
From: Paul Loht
Date: Sat, 17 Mar 2001 16:11
Date: Sat, 17 Mar 2001 16:11
50 lines
1566 bytes
1566 bytes
I am trying to load a dll written with Delphi from a java program, and I am
getting the error:
java.lang.UnsatisfiedLinkError: MyMax
I can't seem to spot the problem. Here is the code for the java program and
the dll, can anyone see the problem?
package NativeTestPackage;
public class NativeMaxClass {
public static native int MyMax(int x, int y);
static
{
System.loadLibrary("NativeMax");
}
public NativeMaxClass()
{
}
public static void main(String[] args)
{
int i, j, k;
j = 13;
k = 2;
i = MyMax(j, k);
}
}
library NativeMax;
uses
SysUtils;
function MyMax(x, y: Integer): Integer; stdcall;
begin
if X > Y then
Result := X
else Result := Y;
end;
exports
MyMax;
begin
end.
Technical Details
Message-ID:
<3ab38e3f_1@dnews>Path:
arc1-ca.pugleaf.net!supernews.google.com!sn-xit-03!supernews.com!newsfeed.wirehub.nl!PeerFeed.KWeb.on.ca!dnews!199.172.202.248Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1089d0,6c42ea9d61f8e960,start X-Google-Attributes: gid1089d0,public X-Google-ArrivalTime: 2001-03-17 08:28:12 PST Reply-To: "Paul Loht" <ploht@promisant.com> From: "Paul Loht" <ploht@promisant.com> Newsgroups: borland.public.jbuilder.java.api Subject: JNI Link Error Date: Sat, 17 Mar 2001 11:11:15 -0500 Lines: 53 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4133.2400 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 NNTP-Posting-Host: 199.172.202.248 Message-ID: <3ab38e3f_1@dnews> X-Trace: 17 Mar 2001 08:18:07 -0800, 199.172.202.248 Path: arc1-ca.pugleaf.net!supernews.google.com!sn-xit-03!supernews.com!newsfeed.wirehub.nl!PeerFeed.KWeb.on.ca!dnews!199.172.202.248