[英]Invoking C++ code from Java (GCJ)
I'm trying to invoke C++ from Java using GCJ using the CNI, so far I'm able to invoke Java code from C++. 我正在尝试使用CNI使用GCJ从Java调用C ++,到目前为止我能够从C ++调用Java代码。 How can I invoke C++ from Java using the CNI?
如何使用CNI从Java调用C ++?
I'll extend somewhat on pcent's answer to read the GCJ/CNI Docs . 我会稍微谈谈pcent读取GCJ / CNI Docs的答案。
I believe that the key is to understand the whole "CNI C++ class" concept. 我认为关键是要了解整个“CNI C ++类”的概念。
Most of the documentation describes how the Java conventions translate in a CNI C++ class. 大多数文档描述了Java约定如何在CNI C ++类中进行转换。
尝试阅读GCJ / CNI文档
I'm not a good Java-programmer, but I'm familar with C#/C++ interop. 我不是一个优秀的Java程序员,但我熟悉C#/ C ++互操作。 The best solution for me to call from native C++ to managed C# was using Callbacks .
我从本机C ++调用托管C#的最佳解决方案是使用Callbacks 。 I think this applies also to JNI
我认为这也适用于JNI
Try reading: http://www.tidytutorials.com/2009/07/java-native-interface-jni-example-using.html 请尝试阅读: http : //www.tidytutorials.com/2009/07/java-native-interface-jni-example-using.html
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.