From: Yu Q. <qi...@po...> - 2011-07-04 10:32:17
|
Dear all, vector.h class Vector{ int n; public: Vector(); virtual ~Vector(); void print(); typedef struct { double x,y,z; }Vect; }; vector.cpp #include "vector.h" #include <stdio.h> #include <string.h> #include <iostream> Vector::Vector() { } void Vector::print() { Vect *vect; printf("f\n"); vect->x = 5; } Vector::~Vector() { printf("destructeur\n"); } vector.i %module vector %{ #include "vector.h" typedef struct Vect; %} %include "vector.h" typedef struct Vect; Everything is correct, the compilation works everywell. And when I wanted to execute with Java, this message appeared: A fatal error has been detected by the Java Runtime Environment: EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x7c82f585, pid=8864, tid=9196 JRE version : 6.0_25-b06 Java VM: Java HotSport <TM> Client VM <20.0-b11 mixed mode, sharing windows-x86 I saw that typedef struct is supported by SWIG. Does someone have an idea? Thanks a lot QIN Yu -- View this message in context: http://old.nabble.com/-SWIG-and-Java--problem-of-typedef-struct-tp31988406p31988406.html Sent from the swig-user mailing list archive at Nabble.com. |