This is the mail archive of the java@gcc.gnu.org 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]
Other format: [Raw text]

Re: compile against library needs classes?!


>>>>> "Christian" == Christian Stuellenberg <gcj@stuellenberg.de> writes:
>>>>> "Bryce" == Bryce McKinlay <bryce@mckinlay.net.nz> writes:
Hello,

    Christian> How is it possible to compile a native executable with
    Christian> gcj from a .java file with an reference to another (but
    Christian> already compiled as an DSO/static lib) Java class?
    Bryce> You need the class file for that class. GCJ needs it to
    Bryce> determine type information for the classes you reference in
    Bryce> your code. Just as you need header files to compile against
    Bryce> a C library, you need class files to compile against a Java
    Bryce> library.

Ok, this makes sense to me.
Can't I use 

gcjh HW_lib (which gives me
#ifndef __HW_lib__
#define __HW_lib__
#pragma interface
#include <java/lang/Object.h>
extern "Java"
{
  class HW_lib;
};
class ::HW_lib : public ::java::lang::Object
{
public:
  HW_lib ();
  static jint foo;

  static ::java::lang::Class class$;
};
)

and take this generated HW_lib.h as header for the Java library?
(If not, for what purposes can I use gcjh?  "Only" JNI, CNI?)

Regards,
Christian


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