This is the mail archive of the
java-discuss@sources.redhat.com
mailing list for the Java project.
Re: Link errors: Confused about calling C code from GCJ via jni
- To: Barnet Wagman <wagman at enteract dot com>
- Subject: Re: Link errors: Confused about calling C code from GCJ via jni
- From: Tom Tromey <tromey at redhat dot com>
- Date: 14 Jan 2001 12:44:03 -0700
- Cc: "java-discuss at sources dot redhat dot com" <java-discuss at sources dot redhat dot com>
- References: <3A61DC19.95F622DA@enteract.com>
- Reply-To: tromey at redhat dot com
>>>>> "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