public inbox for java@gcc.gnu.org
 help / color / mirror / Atom feed
* Using libraries - CNI and JNI
@ 2014-04-12  9:37 Jan Knezik
  2014-04-12 17:46 ` Bryce McKinlay
  0 siblings, 1 reply; 2+ messages in thread
From: Jan Knezik @ 2014-04-12  9:37 UTC (permalink / raw)
  To: java

Hello guys,
I have some questions about GCJ:

1. Is it possible to compile and get work together main programme and 
.so library (both written in Java) with GCJ using CNI or JNI?

2. I have the following code:

public class Test {
     static {
         System.loadLibrary("Test");
     }

     public native void hello();

     public static void main(String[] args) {
         new Test().hello();
     }
}

I tried to compile it with "gcj Test.java --main=Test -o Test.bin". I got:

/tmp/ccWZkOjd.o:(.data+0x50): undefined reference to `hidden alias for 
void Test::hello()'
/tmp/ccWZkOjd.o:(.data+0xc8): undefined reference to `hidden alias for 
void Test::hello()'

I did not use "-fjni" so CNI should have been set. Where is the problem, 
please? Thank you.

Jan Knezik

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-04-12 17:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-04-12  9:37 Using libraries - CNI and JNI Jan Knezik
2014-04-12 17:46 ` Bryce McKinlay

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).