compile against library needs classes?!
Christian Stuellenberg
gcj@stuellenberg.de
Thu Sep 11 14:32:00 GMT 2003
>>>>> "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
More information about the Java
mailing list