Hi everybody,<br><div class="gmail_quote">first of all, thank you for the ITK product: I found them very useful.<br>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:
<br> <br>1) Create a xml description of the c++ code<br>2) Create the index<br>3) Create the cable/swig wrapper<br>4) Compile the original class and the created wrapper in a shared lib<br>5) Load it into python (or whatever)
<br><br>Now I'm creating a very small library called (guess how?) hello.cxx<br><br>my actual pipeline is:<br>1) gccxml -fxml=hello.xml -DCSWIG -DCABLE_CONFIGURATION hello.cxx<br>2) cableidx hello.xml hello.idx<br>
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<br>4) gcc -shared -o _hello.so hello.cxx hello_wrap.cxx -I/usr/include/python2.5/<br clear="all"><br>The commands complete correctly and I have the module _hello.so created.
<br>But when I try to use it from python it says:
<br>"ImportError: ./_hello.so: undefined symbol: SWIG_Python_newvarlink"<br><br>There seems to me that I'm missing a library somewhere but where?<br><br>Thank you for every help!<br><font color="#888888"><br>
<br>Mario<br>
</font></div><br>