Problem creating a JNI DLL using Cygwin with Java 1.3
Harris, Andrew S
Andrew.Harris@capgemini.co.uk
Mon Sep 11 09:03:00 GMT 2000
I'm trying to create a Java JNI DLL using Java 1.3 and the latest Cygwin,
without success.
I'm using the Java JNI examples from
http://www.xraylith.wisc.edu/~khan/software/gnu-win32/index.html#java-jni ,
specifically Makefile.cyg with HelloWorldImp.c.
The makefile fails with this message:
$ make -mf Makefile.cyg
gcc -c -DBUILDING_DLL=1 -D_DLL=1 -I. -Ic:/java/jdk1.3/include
-Ic:/java/jdk1.3
/include/cygwin -g -Wall -O2 -o HelloWorldImp.o HelloWorldImp.c
dllwrap --output-def hello.def --add-stdcall-alias --driver-name gcc
-o hello.
dll \
HelloWorldImp.o -Wl,-e,__cygwin_noncygwin_dll_entry@12 -s
dllwrap: no export definition file provided
dllwrap: creating one, but that may not be what you want
/usr/lib/libcygwin.a(dll_entry.o)(.text+0xfa):dll_entry.cc:
undefined reference
to `_cygwin_dll_entry@12'
collect2: ld returned 1 exit status
dllwrap: gcc exited with status 1
make: *** [hello.dll] Error 1
$
Hope you can help me with this.
My jni_md.h file is:
#ifndef _JAVASOFT_JNI_MD_H_
#define _JAVASOFT_JNI_MD_H_
#define JNIEXPORT __declspec(dllexport)
#define JNIIMPORT __declspec(dllimport)
#define JNICALL __stdcall
typedef long jint;
#ifdef __GNUC__
typedef long long jlong;
#else
typedef __int64 jlong;
#endif
typedef signed char jbyte;
#endif /* !_JAVASOFT_JNI_MD_H_ */
Previously I tried to follow the instructions in the Cygwin documentation,
however it appears that these instructions may have been written before
dllwrap was created, and in any case I was not able to create a dll
according to the instructions.
Thanks
Andrew Harris
--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com
More information about the Cygwin
mailing list