This is the mail archive of the java-discuss@sourceware.cygnus.com 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]

Re: invoke GCJ .o files from C/C++ program


Cecilia Vy-Ai Le wrote:

> -- Then, I create the following files.  I create
> executeable MainApp.  When I run it, it stops when
> trying to invoke method printLine().  I walk through
> the debugger, and see that java::lang:Object does not
> recognize method printLine() (the method is hidden
> some how in the class Object).  Does CNI have any API
> to invoke this method for now?

I think the problem here may be that you have class names which are
different from the filenames that they are declared in (although the
compiler should pick this up...). I renamed "JavaHello.java" to
"JavaTool.java" and changed JavaMain::run to MainApp::run, then compiled
with the following command:

$ gcj MainApp.java JavaTool.java RunApp.cc --main=MainApp -o app -I.

... and it works fine:

$ ./app
Hello World from Java

regards

  [ bryce ]



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