This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: Error calling method from a shared object
- From: Tom Tromey <tromey at redhat dot com>
- To: Ashish Srivastava <ashish7s at yahoo dot com>
- Cc: java at gcc dot gnu dot org
- Date: 05 Feb 2003 11:35:21 -0700
- Subject: Re: Error calling method from a shared object
- References: <20030205033314.95561.qmail@web14005.mail.yahoo.com>
- Reply-to: tromey at redhat dot com
>>>>> "Ashish" == Ashish Srivastava <ashish7s@yahoo.com> writes:
Ashish> public class A {
Ashish> public prnt() {
Ashish> System.out.println("Hello World");
This is a non-static method, so you must call it with an object
reference.
Ashish> Compiled it with gcj and linked libgcj.so and
Ashish> libiconv.so and created a shared object libA.so. Again
Ashish> wrote a short 'C' program :
Ashish> main() {
Ashish> _Zx726xkjad();
Ashish> }
Haven't seen that before! This won't work. libgcj is not just an
ordinary library; it requires a certain amount of setup.
Instead I suggest you do one of these things:
* Write a `main' method in java (see Java documentation and also the
gcj manual)
* Use the CNI invocation interface (gcj manual)
* Use the JNI invocation interface (JNI manual or book)
Tom