using CNI (call compiled java from c++)

Anthony Green green@redhat.com
Mon Feb 7 17:38:00 GMT 2005


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


More information about the Java mailing list

AltStyle によって変換されたページ (->オリジナル) /