[Insight-users] CableSwig: Error parsing XML

Brad King brad.king at kitware.com
Wed Mar 30 13:16:04 EST 2005


Nick Allen wrote:
> I am trying to use cable swig and have had very little success.  I have
> been able to build successfully, but when I run cswig I get the
> following error:
[snip]
> cswig -I/usr/lib/python2.3/ -python -c++ -module poop poop.h
[snip]
> Any ideas on what my problem is?  Thanks in advance for any help.

You can't just run cswig directly on a header file.  You have to use 
gccxml to first produce xml output.  Then you have to use cableidx to 
produce "index" files.  FYI, CableSwig was written specifically to wrap 
ITK and is not really supported outside of that purpose.  That's why 
there isn't much documentation.  The only place I can tell you to look 
for help is in the ITK source tree under Wrapping/CSwig for an example 
wrapping configuration (though very complicated).

If you are interested specifically in python wrapping (and not other 
languages) then you may want to look at pyste 
(http://www.boost.org/libs/python/pyste).  It uses the same parser 
(gccxml) as CableSwig but produces Boost.Python wrappers instead of SWIG 
wrappers and it has better documentation.

-Brad


More information about the Insight-users mailing list