This is the mail archive of the java-discuss@sources.redhat.com 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]

Re: Link errors: Confused about calling C code from GCJ via jni


>>>>> "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

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