This is the mail archive of the java@gcc.gnu.org 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]
Other format: [Raw text]

Re: using CNI (call compiled java from c++)


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



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