Error in simple JNI project
hi,
I am new to JNI and I am trying a simple HelloWorld project but I am getting the following exception :
Exception in thread"main" java.lang.UnsatisfiedLinkError: displayHelloWorld
at HelloWorld.displayHelloWorld(Native Method)
at HelloWorld.main(HelloWorld.java)
where comes my error from?
[356 byte] By [
Isaaka] at [2007-11-26 15:34:52]

# 2
I am trying to implement the example from tutorial:
class HelloWorld {
public native void displayHelloWorld();
static {
System.loadLibrary("hello");
}
public static void main(String[] args) {
new HelloWorld().displayHelloWorld();
}
}
after I am having some dificulties to generate dll where (I think ) are all my difficulties.
cl -Ic:\java\include -Ic:\java\include\win32
-LD HelloWorldImp.c -Fehello.dll
I am putting my java path of my jdk, what path I have to put for cl -Ic and -LD ?
# 4
c header
/* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h>
/* Header for class HelloWorld */
#ifndef _Included_HelloWorld
#define _Included_HelloWorld
#ifdef __cplusplus
extern "C" {
#endif
/*
* Class:HelloWorld
* Method:displayHelloWorld
* Signature: ()V
*/
JNIEXPORT void JNICALL Java_HelloWorld_displayHelloWorld
(JNIEnv *, jobject);
#ifdef __cplusplus
}
#endif
#endif
implementation for native
#include <jni.h>
#include "HelloWorld.h"
#include <stdio.h>
JNIEXPORT void JNICALL
Java_HelloWorld_displayHelloWorld(JNIEnv *env, jobject obj)
{
printf("Hello world!\n");
return;
}