SWIG help, very new

Enrico Ng ng at fnmail.com
Thu May 24 17:43:18 CEST 2001


no that didnt work.
I tried puttin the typedef etc into the %{ ... %}
I just dont know what to put in the interface file.
but I get this error:

swig -c++ -python  stack.i
Generating wrappers for Python
c++ -c -fPIC -shared  stack_wrap.c
 stack.c  -DHAVE_CONFIG_H -I/usr/local/ap/include/python2.1
c++ -shared  stack.c stack_wrap.o   -o stackmodule.so
Text relocation remains                         referenced
    against symbol                  offset      in file
push(int, stk **)                   0x1d8       /var/tmp/ccTgATdQ.o
push(int, stk **)                   0x124       /var/tmp/ccTgATdQ.o
push(int, stk **)                   0x178       /var/tmp/ccTgATdQ.o
push(int, stk **)                   0x248       /var/tmp/ccTgATdQ.o
__builtin_new                       0x44        /var/tmp/ccTgATdQ.o
pop(stk **)                         0x100       /var/tmp/ccTgATdQ.o
pop(stk **)                         0x110       /var/tmp/ccTgATdQ.o
pop(stk **)                         0x150       /var/tmp/ccTgATdQ.o
pop(stk **)                         0x160       /var/tmp/ccTgATdQ.o
pop(stk **)                         0x1a4       /var/tmp/ccTgATdQ.o
pop(stk **)                         0x1b4       /var/tmp/ccTgATdQ.o
pop(stk **)                         0x204       /var/tmp/ccTgATdQ.o
pop(stk **)                         0x214       /var/tmp/ccTgATdQ.o
__builtin_delete                    0xbc        /var/tmp/ccTgATdQ.o
.umul                               0x1c4       /var/tmp/ccTgATdQ.o
.div                                0x224       /var/tmp/ccTgATdQ.o
.div                                0x234       /var/tmp/ccTgATdQ.o
ld: fatal: relocations remain against allocatable but non-writable sections
collect2: ld returned 1 exit status


--
--
Enrico Ng <enrico at fnal.gov>
Fermilab - WH 13X
<andres at corrada.com> wrote in message
news:mailman.990673835.13095.python-list at python.org...
> Hi Enrico,
>
> Have you tried adding the following lines to stack.i?:
>
> %{
> #include "stack.c"
> %}
>
> %include "stack.c"
>
> I'm new to SWIG myself and I'm wrapping a C library so I use .h files but
> this might work.
>
> On Wed, May 23, 2001 at 03:33:54PM -0500, Enrico Ng wrote:
> > Hi, I'm very new to SWIG.
> > I wrote a small stack program in C
> > and want to use swig to make a python module with it.
> > but it isnt working for me.
> > Most likely because I'm not really sure what should go in the interface
> > file.
> >
> > --
> > Enrico Ng <enrico at fnal.gov>
> >
> >.
> >.
> >.
> >
>
> -------------------------------------------------------------------------
> > stack.i
> > --------------------------------------------------------------------
> > %module stack
> >
> > typedef struct stk{int data; struct stk *next; struct stk *prev;}STACK;
> > STACK *stack;
> >
>
> ------------------------------------------------------
> Andres Corrada-Emmanuel   Email: andres at corrada.com
> Internet Programming      http://www.mamey.com
> ------------------------------------------------------
>





More information about the Python-list mailing list