This is the mail archive of the
java-discuss@sourceware.cygnus.com
mailing list for the Java project.
Re: invoke GCJ .o files from C/C++ program
- To: Cecilia Vy-Ai Le <a1tv86 at yahoo dot com>
- Subject: Re: invoke GCJ .o files from C/C++ program
- From: Bryce McKinlay <bryce at albatross dot co dot nz>
- Date: Fri, 07 Jul 2000 11:18:19 +1200
- CC: Jeff Sturm <jeff dot sturm at appnet dot com>, java-discuss at sourceware dot cygnus dot com
- References: <20000706225512.19687.qmail@web1206.mail.yahoo.com>
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 ]