gcj -fjni -> error from assember. Re: Link errors: Confused about calling C code from GCJ via jni
Barnet Wagman
wagman@enteract.com
Sun Jan 14 12:50:00 GMT 2001
The -fjniÃÂ option to gcj yields an error from the assembler:
gcj -c -fjni Locfit.java
results in
/tmp/ccKRkbOa.s: Assembler messages:
/tmp/ccKRkbOa.s:1546: Error: Ignoring attempt to re-define symbol
/tmp/ccKRkbOa.s:1546: Error: Rest of line ignored. First ignored
character is `,'.
Without -fjni option, the class does compile.ÃÂ (' gcj -fjni Locfit.java'
yields
the same error message.)
Perhaps I need to back up to an older build - I'm using Gcc Version
2.97 20010112 (Experimental),
which was current as of Friday.ÃÂ Does anyone know of a builld
where the -fjni is working?
Regards and thanks,
Barnet
PS This is probably already on someone's todo list: gcj -help is a bit
out of date and doesn't list the -fjni option
ÃÂ
Tom Tromey wrote:
>>>>> "Barnet" == Barnet Wagman <wagman@enteract.com>
writes:
Barnet> The header generated by gcjh looks like C to me, but when I
Barnet> try to link this library against gcj compiled java, it looks
Barnet> as if gcj is looking for C++.
It is.
If you have a Java class with native methods written using JNI and not
CNI, then you have to compile that class using `-fjni'.ÃÂ This
will
cause gcj to generate the appropriate stubs for making JNI calls.
This won't work if you are using gcj 2.95, because JNI was not
implemented until after that release.
This is one of many topics that will be addressed by the
documentation.
Tom
More information about the Java
mailing list