
Chapter 6. Java Native Interface (JNI) 105
JNIEXPORT void JNICALL
Java_Java2C2CobolExample_callCobol(JNIEnv *e, jobject o) {
printf("Hello World from C program!!\n");
MYCOB1();
}
Creating a Dynamic Link Library
In this step, you need to create a Dynamic Link Library (DLL) which contains the
C glue program and the COBOL program described in earlier section. You can
create a DLL file by using the following commands:
c89 -c -o Java2C2CobolExample.o -W "c,langlvl(extended)"
-W c,expo,dll -DNEEDSIEEE754 -DNEEDSLONGLONG
-I/usr/lpp/java/J5.0/include Java2C2CobolExample.c
c89 -W l,dll -o libMyLib.so Java2C2CobolExample.o
"//'KENICHI.OB(MYCOB1)'" ...