win32: Why exports of JNI_* symbols from _exe_ files

Jeff Sturm
Tue Aug 5 04:03:00 GMT 2003

On Tue, 5 Aug 2003, [iso-8859-1] Danny Smith wrote:
> The libarary:
> /* foo.c */
> void __declspec(dllexport) foo()
> { }
> The client:
> /* main.c */
> extern  __declspec(dllimport) void foo();
> int main()
> {
>   foo();
>   return 0;
> }
> gcc -c foo.c
> gcc main.c foo.o
> D:\TEMP/ccWgaaaa.o(.text+0x1f):main.c: undefined reference to `_imp__foo'

Really?  This symbol isn't satisfied by a corresponding dllexport within
the same .exe?  (If so, I understand even less about declspec than I
previously thought.)

> I'm wondering if the JNIEXP attribute should also be removed from the
> definitions in  If you want to specify what goes into a .dll,
> can always use a .DEF file when building the dll (or .exe for that
> matter).

Good point.  I presume anyone who needs to make a DLL out of libgcj.a
knows what this means.

Care to submit a patch?


More information about the Java mailing list