Swig-Python problems

Pierre Rouleau prouleau at impathnetworks.com
Thu Mar 18 02:20:22 CET 2004


matteo wrote:

> 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??

What does your interface space file (examplei.i) contain?




More information about the Python-list mailing list