From: Christian M. <mee...@gm...> - 2009-03-09 21:05:31
|
Hi, When running SWIG on this function: http://svn.origo.ethz.ch/viewvc/sas-rigid/test/calc.c?revision=211&view=markup with '$ swig -python calc.i' I get no complaints from swig at all. Nice. But the compiling results in the following errors: gcc: src/calc_wrap.c src/calc_wrap.c:2509: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before string constant src/calc_wrap.c:2510: warning: useless storage class specifier in empty declaration src/calc_wrap.c: In function ‘_wrap__pofr’: src/calc_wrap.c:2518: error: ‘coordinate’ undeclared (first use in this function) src/calc_wrap.c:2518: error: (Each undeclared identifier is reported only once src/calc_wrap.c:2518: error: for each function it appears in.) src/calc_wrap.c:2518: error: ‘arg2’ undeclared (first use in this function) src/calc_wrap.c:2537: error: expected expression before ‘)’ token src/calc_wrap.c:2538: warning: implicit declaration of function ‘_pofr’ src/calc_wrap.c:2538: warning: cast to pointer from integer of different size src/calc_wrap.c:2509: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before string constant src/calc_wrap.c:2510: warning: useless storage class specifier in empty declaration src/calc_wrap.c: In function ‘_wrap__pofr’: src/calc_wrap.c:2518: error: ‘coordinate’ undeclared (first use in this function) src/calc_wrap.c:2518: error: (Each undeclared identifier is reported only once src/calc_wrap.c:2518: error: for each function it appears in.) src/calc_wrap.c:2518: error: ‘arg2’ undeclared (first use in this function) src/calc_wrap.c:2537: error: expected expression before ‘)’ token src/calc_wrap.c:2538: warning: implicit declaration of function ‘_pofr’ src/calc_wrap.c:2538: warning: cast to pointer from integer of different size error: Command "gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.5 -c src/calc_wrap.c -o build/temp.linux-x86_64-2.5/src/calc_wrap.o" failed with exit status 1 and my calc.i file is %module calcwrap %{ import "calc.h"; typedef struct coordinate; %} typedef struct coordinate; extern unsigned long *_pofr(double r[], coordinate coords[]); I presume I am naive at some point. Can anybody tell me my mistake? (Or give an example on what I need to correct? TIA Christian |