newbie question: need help linking

Andrew Haley
Wed Dec 1 14:28:00 GMT 2004

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.


More information about the Java mailing list