This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: newbie question: need help linking
- From: Andrew Haley <aph at redhat dot com>
- To: "Prabhakar, Vijay (IT)" <Vijay dot Prabhakar at morganstanley dot com>
- Cc: <java at gcc dot gnu dot org>
- Date: Wed, 1 Dec 2004 14:27:41 +0000
- Subject: Re: newbie question: need help linking
- References: <B02B40763A4E244B85073170FFFE10887B5F7F@NYWEXMB27.msad.ms.com>
Prabhakar, Vijay (IT) writes:
> Hi, I'm having a few problems with which I was hoping someone could help
> me out. I'm using GCJ 3.2.3-42. I'm not sure if this is possible,
> which might explain why I can't get this system running. I have a
> program that is written in C++ and it uses several libraries. I'm
> trying to change one of the libraries to Java while leaving a C++
> interface to it so the original program can continue running without
> changes.
>
> So essentially, I have a C++ class with a main, calling another C++
> class which calls a Java class. So I compile my Java class with GCJ and
> produce the C++ header file. Both C++ classes compile fine as well.
> However, I cannot get the program to link. I can get it to link if I
> compile the Java source file to an object file, but not a class file.
Right: that's what gcj does. There is, at present, no easy way to
call CNI code directly from a .class file. It can be done indirectly,
but that's another matter.
Andrew.