Help me please.. I have to create JNI+DLL to call dll function

I have following files

1. aaa.java

2. aaa.class

3. aaa.h

4. aaajni.c

If source code of aaajni.c has only printf("xxx");

everything works fine

But I have to write my source code in aaajni.c

to call function in

5. bbb.dll

Everytime I try to compile my aaajni.c

D:\workspace\TestJniDll>cl -Ic:\jdk1.3.1_06\include -Ic:\jdk1.3.1_06\include\win

32 -LD aaaJni.c -Feaaajni.dll

Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 12.00.8168 for 80x86

Copyright (C) Microsoft Corp 1984-1998. All rights reserved.

EtbGatewayJni.c

Microsoft (R) Incremental Linker Version 6.00.8168

Copyright (C) Microsoft Corp 1992-1998. All rights reserved.

/dll

/implib:aaajni.lib

/out:aaajni.dll

aaaJni.obj

Creating library aaajni.lib and object aaajni.exp

aaaJni.obj :

error LNK2001: unresolved external symbol __imp__bbbfunc

aaajni.dll : fatal error LNK1120: 1 unresolved externals

These errors always occur I don't know why this happen

do I need to put special parameters?

[1129 byte] By [Paisal_da] at [2007-10-3 2:49:54]
# 1
So what is bbbfunc ?
bschauwejavaa at 2007-7-14 20:38:42 > top of Java-index,Java HotSpot Virtual Machine,Specifications...
# 2

Hi

Let me know how your source code looks.

Have you used this format

JNIEXPORT jboolean JNICALL Java_JNIBridge_Dialer(JNIEnv * env, jclass jobj){

printf("Inside Dialer\n");

return true;

}

1. You have to create a header file using javah for your jni interface functions

2. include the header file in the c code

3. .define the functions as above example

4. try to compile

Sundar_Na at 2007-7-14 20:38:42 > top of Java-index,Java HotSpot Virtual Machine,Specifications...
# 3
I have solved this problem. My Old source code is using (*env)->xxxnow I changed it to env->xxxand I can call dll from my jnifund.cThanks for all of your help
Paisal_da at 2007-7-14 20:38:42 > top of Java-index,Java HotSpot Virtual Machine,Specifications...