This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: using CNI (call compiled java from c++)
- From: Anthony Green <green at redhat dot com>
- To: David Blasby <dblasby at gmail dot com>
- Cc: java at gcc dot gnu dot org
- Date: Sun, 06 Feb 2005 21:38:16 -0800
- Subject: Re: using CNI (call compiled java from c++)
- Organization: Red Hat, Inc.
- References: <89f845e80502061945334b9c5d@mail.gmail.com>
On Sun, 2005-02-06 at 19:45 -0800, David Blasby wrote:
> #pragma GCC java_exceptions
>
> #include <java/lang/Integer.h>
> #include <gcj/cni.h>
>
> int main(int argc, char** argv)
> {
> java::lang::Integer *x = new java::lang::Integer( 234);
> }
>
> $ gcc -g test2.cc -lgcj ; ./a.out
> Segmentation fault
Your program is missing all of the required invocation glue
(JvCreateJavaVM, JvAttachCurrentThread, etc). See the docs and example
here: http://gcc.gnu.org/onlinedocs/gcj/Invocation.html
AG