This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: compile against library needs classes?!
Christian Stuellenberg writes:
> >>>>> "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
>
>
> and take this generated HW_lib.h as header for the Java library?
No. Only the C++ compiler can read C++ source.
> (If not, for what purposes can I use gcjh? "Only" JNI, CNI?)
Right.
Andrew.