Swig-Python problems

matteo m.finardi at itia.cnr.it
Mon Mar 15 10:39:21 EST 2004


Hi, I've got a problem with SWIG and Python2.2.I've installed the
SWIG1.3.21 releaseunder QNX6.2 platform .I tried to make the exemple
example.c (in the directory ../Swig/Exemple/python/simple)
/* File : example.c */
 
 #include <time.h>
 double My_variable = 3.0;
 
 int fact(int n) {
     if (n <= 1) return 1;
     else return n*fact(n-1);
 }
 
 int my_mod(int x, int y) {
     return (x%y);
 }
 	
 char *get_time()
 {
     time_t ltime;
     time(&ltime);
     return ctime(&ltime);
 }.
After the commans:

 swig -python example.i
 gcc -c example.c example_wrap.c -I/usr/local/python2.2
 ld -shared example.o example_wrap.o -o _example.so 

 I use Python module as follows

 >>> import example

and I've got the message: "Memory falut (core dumped)"
What can I do??



More information about the Python-list mailing list