problem with SWIG

Roger Hansen rogerha at ifi.uio.no
Mon May 22 07:52:50 EDT 2000


* shilitg at t2.technion.ac.il
> 
> Hi,
> 
> I am trying to connect python to cpp files.
> Our project contains lots of files, the main file is fdtd.cpp and it
> calls functions in other files.
> When I try to use swig I get errors:
> ~/code>swig -python -module fdtd fdtd.cpp

Heres possibly two mistakes. Since you're dealing with c++ you must
turn on the -c++ option. You probably want the -shadow option as well.
I guess that you use an incorrect makefile. Try to look at the
Makefile in the python/array/ example that follows with SWIG.

> If you know how to solve or if you have an example of how you work
> with more than 1 file with SWIG, please help!

I also advise you to check the SWIG User Guide at
<Url: http://swig.sourceforge.net/ > for reading about SWIG and c++.
There is also a mailing list, which is a more proper place for
SWIG-related discussions I suppose.



R



More information about the Python-list mailing list