This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: win32: Why exports of JNI_* symbols from _exe_ files


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 jni.cc.  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?

Jeff


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]