load native lib (SWT) with JNI on windows

Tom Tromey tromey@redhat.com
Fri Nov 22 13:26:00 GMT 2002


>>>>> "Ranjit" == Ranjit Mathew <rmathew@vsnl.net> writes:

Ranjit> To complement the situation perfectly, the MinGW ld omits the
Ranjit> underscore in both the cases and adds the @nn for stdcall
Ranjit> functions.

Is it really ld that does this?  I thought the compiler made all the
name mangling decisions.

Ranjit> Therefore, for a given JNI method fooBar( ) implemented in a DLL,
Ranjit> the LookupJNIMethod( ) function must search for all of
Ranjit> "fooBar@nn" (GCC), "_fooBar@nn" (MSVC) and "fooBar" (BCC).
Ranjit> (Assuming these are the only compilers we care to support.)

Was this decision made consciously by gcc?  Maybe it is just a bug and
we should also prefix `_' to stdcall methods.  Can you find out?

In any case it looks like we'll need more Windows-specific code in the
JNI lookup.

Tom



More information about the Java mailing list