It's not a secret anymore!
The moose likes Java in General and the fly likes Link Error Which is Never Satisfied Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Introducing JavaFX 8 Programming this week in the JavaFX forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Link Error Which is Never Satisfied" Watch "Link Error Which is Never Satisfied" New topic

Link Error Which is Never Satisfied

kundan vyas

Joined: Jun 22, 2000
Posts: 5
Hi Guys,
Even I am facing a similar problem.I am trying to call a function from kernel32.dll .
My Code
public class HelloWorld {
public native boolean Beep(long freq,long duration);

static {
System.out.println("arg debug: after loadLibrary");

public static void main(String[] args) {
HelloWorld obj=new HelloWorld();
boolean flag=obj.Beep(500L,500L);
I am executing the following steps
2)javah -jni HelloWorld
3)java HelloWorld
I am getting the following error
java.lang.UnsatisfiedLinkError: Beep at
at HelloWorld.Beep(Native Method)
at HelloWorld.main(
I ve also tried the System.load("c:/windows/system/kernel32.dll") method. The library seems to be getting loaded either ways. I think HelloWorld.h header file has some problem.
Do I need to put my HelloWorld.h file in the include folder of JDK. Kindly check this problem.
Servin Park

Joined: May 10, 2002
Posts: 26
As far as I know, you have to build HelloWorld.dll from HelloWorld.h created by executing javah -jni HelloWorld. You can't just use kernel32.dll. After building HelloWorld.dll, do either System.loadLibrary("HelloWorld") or System.load("C:/path/to/your/HelloWorld.dll");. Refer to Sun's JNI overview. It gives ample explanation on how to program JNI.
[ June 27, 2002: Message edited by: Servin Park ]
I agree. Here's the link:
subject: Link Error Which is Never Satisfied
It's not a secret anymore!