JNI with Cygwin32

Andrew Mickish mickish@cmu.edu
Fri Oct 16 06:08:00 GMT 1998


One thing that I don't recall mentioning in any of my previous posts is that
editing one of the Java header files is necessary. I guess VC++ defines a type
called __int64, which is not defined in the gcc header files. In your jdk
directory, change include/win32/jni_md.h to look like this:
 #define JNIEXPORT /*__declspec(dllexport)*/
 #define JNICALL __stdcall
 typedef long jint;
 typedef long /*__int64*/ jlong;
 typedef signed char jbyte;
Maybe someone else can say whether this is actually an oversight in the gcc
header files.
The line above about declspec has to do with the different ways that VC++ and
gcc export functions from DLLs. VC++ uses a simple keyword, but gcc has a
convoluted linking procedure based on an init.cc file. I have been subscribed
to the list for months hoping to hear justification for this, or the
announcement of a simplified procedure, but haven't heard anything yet.
If you send me a trace of your remaining errors I will see if I recognize
anything.
--Andrew Mickish
S. Suchitra wrote:
> Hi,
>> I have been reading your messages on the Cygwin32 mailing list
> about getting JNI to work with gcc on the Cygnus Win32 interface.
> I downloaded your zip file with the HelloWorld example. However I am
> not able to compile it using your Makefile..it seems to be giving a
> number of parse and syntax errors in header files like jni.h and some other
> files in the Cygwin32 library.
>> I was wondering whether you also had similar problems and how you overcame
> them. I would really appreciate any pointers you may be able to give me.
> I am working on a Windows Nt 4.0 machine with Cygnus Win 32 19.1 release.
>> Thanking you,
> Suchitra.
>> srinis@caip.rutgers.edu

-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".


More information about the Cygwin mailing list

AltStyle によって変換されたページ (->オリジナル) /