Swig-Python problems

Armin Steinhoff a-steinhoff at web.de
Tue Mar 16 21:47:48 CET 2004


m.finardi at itia.cnr.it (matteo) wrote in message news:<cdb8761d.0403150739.5de0fee4 at posting.google.com>...
> 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

   At first ... please use qcc and not gcc.

   qcc -c -fPIC example.c example_wrap.c -I/usr/local/python2.2

   should work ...

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

  ... use Pyrex :)

  Armin Steinhoff



More information about the Python-list mailing list