This is the mail archive of the
cygwin@sources.redhat.com
mailing list for the Cygwin project.
Problem creating a JNI DLL using Cygwin with Java 1.3
- To: "'cygwin at sourceware dot cygnus dot com'" <cygwin at sourceware dot cygnus dot com>
- Subject: Problem creating a JNI DLL using Cygwin with Java 1.3
- From: "Harris, Andrew S" <Andrew dot Harris at capgemini dot co dot uk>
- Date: Mon, 11 Sep 2000 17:03:36 +0100
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