compile error on SWIG file

Lyle Johnson lyle at
Mon Sep 9 14:34:35 EDT 2002

Markus von Ehr wrote:

> I only extended the std_vector example from the distribution with
> one function, see example.i included (there are templates inside).
> When I run SWIG with -c++ option, the warnings disappear in fact.
> But the error from the compiler is the same...


If you named the output file "mvelib.c", you are telling your compiler 
that it's C source code (and it isn't). It's C++ source code, so give it 
a C++ extension, e.g.

	swig -c++ -python -o mvelib.cpp mvelib.i

You will also need to update your script to use the corrected 
file name ("mvelib.cpp" instead of "mvelib.c").


More information about the Python-list mailing list