[gcj+cni] Segmentation fault when accessing java code from c++

David Daney ddaney@avtrex.com
Wed Apr 23 20:32:00 GMT 2008


Christian Nolte wrote:

> 
> int main() {
>   Test t;
>   t.test2();
> }
> - ---
> 
.
.
.
> 
> Am I doing something wrong, i.e. do I miss some preinitialization which
> is needed to get CNI working? Or is this a bug in my libgcj?
> 

In short yes.  If you are calling from C++ into CNI code, you must use 
the invocation interface (much as you must use the JIN invocation 
interface when using JIN).

See: http://gcc.gnu.org/onlinedocs/gcc-4.3.0/gcj/Invocation.html

For details.

David Daney



More information about the Java mailing list