[Insight-users] CSWIG use

Mario Ceresa mario.ceresa at torrescalla.it
Thu Jan 24 12:46:05 EST 2008


Hi everybody,
first of all, thank you for the ITK product: I found them very useful.
I'm interested in using CSWIG to make a c++ wrapping of a different program,
and trying to understand how it works from the examples. As far as I got
these are the steps required to wrap a c++ extension with cswig:

1) Create a xml description of the c++ code
2) Create the index
3) Create the  cable/swig wrapper
4) Compile the original class and the created wrapper  in a  shared  lib
5) Load it into python (or whatever)

Now I'm creating a very small library called (guess how?) hello.cxx

my actual pipeline is:
1)  gccxml -fxml=hello.xml -DCSWIG -DCABLE_CONFIGURATION hello.cxx
2)    cableidx hello.xml hello.idx
3)    cswig -ICableSwig-ITK-3.4.0/SWIG/Lib/
-ICableSwig-ITK-3.4.0/SWIG/Lib/python
-module hello -noruntime -Cindex hello.idx -Wall -o hello_wrap.cxx -python
-c++ hello.xml
4) gcc -shared -o _hello.so hello.cxx hello_wrap.cxx
-I/usr/include/python2.5/

The commands complete correctly and I have the module _hello.so created.
But when I try to use it from python it says:
"ImportError: ./_hello.so: undefined symbol: SWIG_Python_newvarlink"

There seems to me that I'm missing a library somewhere but where?

Thank you for every help!


Mario
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/insight-users/attachments/20080124/45b57d38/attachment.html


More information about the Insight-users mailing list